.. _nep_common:


********
 Common
********

The ``nep-common`` package is the core of NEP Design and the starting point for a new NetEye setup. It provides the minimum requirements to implement a basic monitoring of remote systems and to display their status. With ``nep-common`` it is possible to perform standard monitoring of:

- Windows-based servers and clients through the Icinga 2 Agent
- Linux-based servers and clients through the Icinga 2 Agent

Using the provided objects, is also possible to:

- Perform basic SNMP monitoring (by querying SNMP devices for specific OIDs)
- Prepare a common base for passive monitoring
- Represent Objects that are not strictly related to a server or its services


Minimum supported environment
=============================
This package can be installed on systems running the software described below. Systems with equivalent components are also suitable for installation.

================= ===============
Required software Requirements
================= ===============
NetEye            Version ``4.20+``
NetEye  modules   ``Core``
================= ===============


Package requirements
====================
ITOA Dashboards shipped with the``nep-common`` package require Icinga 2 features ``influxdb`` and ``ido-mysql`` fully configured and running. Data provided by these two features must be accessible from Grafana using two dedicated Data Sources:

- A Data Source named ``icinga2-influxdb`` able to access data from the ``influxdb`` feature
- A Data Source named ``icinga-mysql`` able to access data from the ``ido-mysql`` feature

Data Source ``icinga2-influxdb`` is available by default on NetEye. If you cannot find it, please read the `Grafana Official Documentation for InfluxDB Data Source`__ and create the appropriate Data Source manually.

.. __: https://grafana.com/docs/grafana/latest/datasources/influxdb/

Data Source ``icinga-mysql`` must be created manually. On a NetEye environment, this Data Source is automatically created by the setup routine. On other systems, please create it manually.
To get more information about Data Source creation, please read the `Grafana Official Documentation for MySQL Data Source`__.

.. __: https://grafana.com/docs/grafana/v7.5/datasources/mysql/


Setup instructions
==================
If all requirements are met, you can now install this package. To manually set up the ``nep-common`` package, just use ``nep-setup`` utility to install it.

.. code:: bash

    nep-setup install nep-common


Available Objects
=================
This section contains a description of all the Objects from this package that can be used to build your own monitoring environment.

Director Objects
----------------
Director Objects are Objects created (or imported) into Icinga Director.
This package contains the following Director Objects:

**Data Lists**
The following Data Lists can be freely customized by the End User. Their purpose is to provide easy data filling to better describe the monitoring environment.

==========================================  ===========
Datalist name                               Description
==========================================  ===========
[NX] Application List                       Used to provide the list of applications in which Host Objects are organized; do not remove the default values
[NX] Environment List                       List of available environment like Production, System Test and so on; do not remove the default values
[NX] System Role List                       List of services a server offers (like DBMS, Web Server, Identity, etc.)
==========================================  ===========

**Host Templates**

The following Host Templates can be used to freely create Host Objects.
Remember to not edit these Host Templates because they will be restored/updated at the next NEP package update.

============================ ===========
Host Template name           Description
============================ ===========
nx-ht-client-agent-linux	 Describe a generic Linux-based client computer monitored by an Icinga 2 Agent.
nx-ht-client-agent-windows	 Describe a generic Windows-based client computer monitored by an Icinga 2 Agent.
nx-ht-dummy	                 This Host Template should be used for all Host Objects not having a proper way to ensure they are online. Host Objects such as fake objects (like Business Process Host) or Objects that must always have the same state should belong to this category.
nx-ht-passive	             This Host Template describes Host Objects whose state can be set using external events like SNMP Traps, Web Hooks etc.
nx-ht-server-agent-linux	 Describe a generic Linux-based server computer monitored by an Icinga 2 Agent.
nx-ht-server-agent-windows	 Describe a generic Windows-based server computer monitored by an Icinga 2 Agent.
nx-ht-server-linux-ssh       Describe a generic Linux-based server computer monitored using SSH as a command transpost protocol
nx-ht-cli                    Describe a generic device that can be monitored using its CLI (Command Line Interface)
nx-ht-restapi                Describe a generic device that can be monitored using its REST API
nx-ht-snmp	                 Describe a generic device that can be monitored using SNMP calls.
nx-ht-virtual	             This Host Template describes objects or services that do not completely correspond to a single device because they are a logical instance or are part of an existing instance. E.g.: Web Sites exposed through a Proxy Server, a database instance running on a specific DBMS and so on.
============================ ===========

**Service Templates**

The following Service Templates can be used to freely create Service Objects, Service Apply Rules or Service Sets.
Remember to not edit these Service Templates because they will be restored/updated at the next NEP Package update.

======================================= ============ ===========
Template name                           Run on Agent Description
======================================= ============ ===========
nx-st-agent-linux-cpu-load	            Yes          Checks CPU Load on a Linux computer
nx-st-agent-linux-disk-freespace        Yes          Checks Disk space usage on a Linux computer
nx-st-agent-linux-memory-usage          Yes          Checks Memory usage on a Linux computer
nx-st-agent-linux-processes-status      Yes          Counts the number of specific processes running on a Linux computer
nx-st-agent-linux-swap-usage            Yes          Checks Swap space usage on a Linux computer
nx-st-agent-linux-init-state            Yes          Check InitD-based unit status on a Linux computer
nx-st-agent-linux-unit-state            Yes          Checks SystemD-based unit status on a Linux computer
nx-st-agent-linux-uptime                Yes          Checks system uptime on a Linux computer
nx-st-agent-windows-cpu-load            Yes          Checks the overall CPU usage on a Windows computer
nx-st-agent-windows-disk-space-usage    Yes          Checks Disk space usage on a Windows computer
nx-st-agent-windows-logged-users        Yes          Checks the number of logged-on users on a Windows computer
nx-st-agent-windows-memory-usage        Yes          Checks Memory usage on a Windows computer
nx-st-agent-windows-network-performance Yes          Checks NIC Performance on a Windows computer
nx-st-agent-windows-performance-counter Yes          Checks the value of a specific Performance Counter on a Windows computer
nx-st-agent-windows-ping                Yes          Pings a specific IP address and checks its performance on a Windows computer
nx-st-agent-windows-processes-count     Yes          Checks the number of processes running on a Windows computer
nx-st-agent-windows-processes-status    Yes          Counts the number of specific processes running on a Windows computer
nx-st-agent-windows-script-cmd          Yes          Launch a local CMD/BAT Script on a Windows computer as a Monitoring Plugin
nx-st-agent-windows-script-cscript      Yes          Launch a local CSV Script on a Windows computer as a Monitoring Plugin
nx-st-agent-windows-script-powershell   Yes          Launch a Powershell Script on a Windows computer as a Monitoring Plugin
nx-st-agent-windows-service-status      Yes          Checks the status of a specific Windows Service on a Windows computer
nx-st-agent-windows-swap-usage          Yes          Checks Swap space usage on a Windows computer
nx-st-agent-windows-updates-pending     Yes          Checks on a Windows computer if updates are pending and/or ready to be installed
nx-st-agent-windows-uptime              Yes          Checks system uptime on a Windows computer
nx-st-agentless-agent-connected         No           Checks if an Icinga Agent is actually connected to the NetEye Monitoring Infrastructure
nx-st-agentless-businessprocess-status  No           Evaluate the status of a specific Node on a given Business Process
nx-st-agentless-ping                    No           Ping a specific IP address from NetEye Monitoring Infrastructure and checks its performance
nx-st-agentless-snmp-oid                No           Checks a specific OID of a remote device via SNMP from NetEye Monitoring INfrastructure
nx-st-passive                           No           Standard Template for Passively monitored services
nx-st-passive-with-autoreset            No           Template for Passively monitored services with Check Freshness
======================================= ============ ===========

**Service Sets**

The following Service Sets can be used to freely monitor Host Objects.
Remember to not edit these Service Sets because they will be restored/updated at the next NEP Package update.

================================ ===========
Service Set name                 Description
================================ ===========
nx-ss-client-agent-windows-basic Service Set providing common monitoring for Windows-based servers
nx-ss-server-agent-linux-basic   Basic performance set for Linux-based servers
nx-ss-server-agent-linux-init    Basic Unit State set for Linux servers with InitD 
nx-ss-server-agent-linux-systemd Basic Unit State set for Linux servers with SystemD
nx-ss-server-agent-windows-basic Service Set providing common monitoring for Windows-based servers
================================ ===========

**Notifications management**

NEP provides basic Icinga2 Notifications management as a feature. Because of modularity, this feature is splitted into different packages.
``nep-common`` provides a series of Custom Variables to manage Notifications: with these Custom Variables is possible to configure Notifications behavior through children of ``nx-ht-type-custom`` or directly at Host/Service Object level.
For further details, plese see documentation of :ref:`NEP Notification Base<nep_notification_base>`.


Icinga2 Objects
---------------
Icinga2 Objects are Objects provided directly using Icinga2 Configuration files.
This package contains the following Icinga2 Objects:

**Dependencies**

The following Dependencies are used to change the behavior of Host Objects and Service Objects in case a specific Parent Object has a problem.

==================================================================== ===========
Object name                                                          Description
==================================================================== ===========
nx-disable-notifications-on-icinga-agent-disconnected                Disable Notifications on Agent controlled Services when the related Icinga2 Agent is disconnected
nx-disable-monitoring-on-icinga-agent-disconnected                   Disable Monitoring on Agent controlled Services when the related Icinga2 Agent is disconnected
nx-disable-notifications-and-monitoring-on-icinga-agent-disconnected Disable both Notifications and Monitoring on Agent controlled Services when the related Icinga2 Agent is disconnected
nx-disable-notifications-on-parent-down                              Disable Notifications on Host Objects when their Parent Host Object is Down while marking them as Unreachable
nx-disable-monitoring-on-parent-down                                 Disable Monitoring on Host Objects when their Parent Host Object is Down while marking them as Unreachable
nx-disable-notifications-and-monitoring-on-parent-down               Disable both Notifications and Monitoring on Host Objects when their Parent Host Object is Down while marking them as Unreachable
==================================================================== ===========

Dependencies ``*on-icinga-agent-disconnected`` are applied to Service Objects that inherits from Service Template ``nx-st-agent`` assigned to Host Objects inheriting from ``nx-ht-client-agent`` or ``nx-ht-server-agent``, and perform their duty when Service Object ``Icinga agent Status`` is not ``OK``. Their behavior is selected by using the Data Field ``[NX] Behavior on Icinga agent Disconnected``, available to all Service Objects inheriting from ``nx-st-agent``.

Dependencies ``*on-parent-down`` are applied to all Host Objects that have at least one Parent Host set. To set a Parent Host, select it suing the Data Field ``[NX] Parent Hosts``, available to all Host Objects inheriting from `nx-ht-type-custom``. Their behavior is selected by using the Data Field ``[NX] Behavior on Parent host down``, available to all Host Objects inheriting from `nx-ht-type-custom``.


ITOA Dashboards
---------------

The Package contains the following ITOA Dashboards.

================================= ===========
Dashboard name                    Description
================================= ===========
Last state History (with filters) This dashboard helps you (IT operation user) to see and filter the NetEye Event Overview from a Grafana Dashboard using quick filters and Time Range selection.
NetEye Home                       This dashboard helps you to quickly understand the health status of a NetEye system (from the point of view of performance monitoring and host performance).
NetEye Problems                   This dashboard helps you to see NetEye Problems (both hosts and services) from a Grafana Dashboard.
Server Overview                   This dashboard helps you to better see basic performance and problems of agent-based monitored objects.
State and Notification History    This dashboard lets you view a summary of how many notifications are produced, by whom, and to whom they are delivered.
================================= ===========


Package's objects list
----------------------

.. csv-table::
    :file: objects_list.csv
    :header-rows: 1