Skip to main content

Alignak checks pack for Linux NRPE monitored hosts

Project description

Alignak checks package for NRPE checked hosts/services

*Checks pack for monitoring Unix/Linux or Windows hosts with NRPE active checks*

.. image::
:alt: Most recent PyPi version

.. image::
:alt: Join the chat #alignak on

.. image::
:alt: License AGPL v3

**Note:** *this check pack is only an example for checking linux / windows hosts using the Nagios NRPE commands. Please feel free to comment or suggest improvements :)*


The installation of this checks pack will copy some configuration files in the Alignak default configuration directory (eg. */usr/local/share/alignak/etc*).
The copied files are located in the default sub-directory used for the packs (eg. *arbiter/packs* for the Nagios legacy cfg files or *arbiter/backend-json* for the backend importable files).

From Alignak packages repositories

More information in the online Alignak documentation. Here is only an abstract...


# Alignak DEB stable packages
sudo echo deb xenial main | sudo tee -a /etc/apt/sources.list.d/alignak.list
sudo apt-key adv --keyserver hkp:// --recv D401AB61

sudo apt-get update
sudo apt install python-alignak-checks-nrpe


sudo vi /etc/yum.repos.d/alignak-stable.repo:
name=Alignak RPM stable packages

sudo yum repolist

sudo yum install python-alignak-checks-nrpe

.. note:: for Python 3 version, replace ``python`` with ``python3`` in the packages name.

From PyPI
To install the package from PyPI::

# Python 2
sudo pip install alignak-checks-nrpe

# Python 3
sudo pip3 install alignak-checks-nrpe

From source files
To install the package from the source files::

git clone
cd alignak-checks-nrpe
sudo pip install .

**Note:** *using `sudo python install` will not correctly manage the package configuration files! The recommended way is really to use `pip`;)*



This checks pack is using the `check_nrpe` Nagios plugin that must be installed on the Alignak server running your poller daemon.

For Unix (FreeBSD), you can simply install the NRPE plugin::

# Simple NRPE
pkg install nrpe

# NRPE with SSL
pkg install nrpe-ssl

# Take care to copy/rename the check_nrpe2 to check_nrpe if needed! Else, replace the check_nrpe
# command with check_nrpe2

For Linux distros, install the Nagios ``check_nrpe`` plugin from your system repository::

# Install local NRPE plugin
sudo apt-get install nagios-nrpe-plugin
# Note: This may install all the Nagios stuff on your machine...

After installation, the plugins are commonly installed in the */usr/local/libexec/nagios* directory.

The */usr/local/etc/alignak/arbiter/packs/resource.d/nrpe.cfg* file defines a global macro
that contains the NRPE check plugin installation path. You must edit this file to update the default path that is defined to the alignak ``$NAGIOSPLUGINSDIR$`` (defined in alignak default configuration).

#-- NRPE check plugin installation directory
# Default is to use the Alignak plugins directory

**Note:** the default value for ``$NAGIOSPLUGINSDIR$`` is set as */usr/lib/nagios/plugins* which is the common installation directory used by the Nagios plugins.

Prepare Unix/Linux monitored hosts

Some operations are necessary on the monitored hosts if NRPE remote access is not yet activated.

# Install local NRPE server
su -
apt-get update
apt-get install nagios-nrpe-server
apt-get install nagios-plugins

# Allow Alignak as a remote host
vi /etc/nagios/nrpe.cfg
allowed_hosts = X.X.X.X

# Restart NRPE daemon
/etc/init.d/nagios-nrpe-server start

Test remote access with the plugins files:

/usr/lib/nagios/plugins/check_nrpe -H -t 9 -u -c check_load

**Note**: This configuration is the default Nagios NRPE daemon configuration. As such it does not allow to define arguments in the NRPE commands and, as of it, the warning / critical threshold are defined on the server side.

Prepare Windows monitored hosts

Some operations are necessary on the Windows monitored hosts if NSClient++ is not yet installed and running.

Install and configure NSClient++ to allow remote NRPE checks. The example below is an NSClient Ini configuration file that allows to use the NRPE server.


# -----------------------------------------------------------------------------
# c:\Program Files\NSClient++\nsclient.ini
# -----------------------------------------------------------------------------

CheckExternalScripts = 1
CheckEventLog = 1
CheckDisk = 1
CheckSystem = 1
NRPEServer = 1

; Alignak server Ip address
allowed hosts = address =

[/settings/external scripts/alias]
alias_cpu = checkCPU warn=80 crit=90 time=5m time=1m time=30s
alias_cpu_ex = checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s
alias_disk = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
alias_disk_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ignore-unreadable
alias_event_log = CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success', 'informational') AND source != 'SideBySide'" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"
alias_file_age = checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%"
alias_file_size = CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10
alias_mem = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page
alias_process = checkProcState "$ARG1$=started"
alias_process_count = checkProcState MaxWarnCount=$ARG2$ MaxCritCount=$ARG3$ "$ARG1$=started"
alias_process_hung = checkProcState MaxWarnCount=1 MaxCritCount=1 "$ARG1$=hung"
alias_process_stopped = checkProcState "$ARG1$=stopped"
alias_sched_all = CheckTaskSched "filter=exit_code ne 0" "syntax=%title%: %exit_code%" warn=>0
alias_sched_long = CheckTaskSched "filter=status = 'running' AND most_recent_run_time < -$ARG1$" "syntax=%title% (%most_recent_run_time%)" warn=>0
alias_sched_task = CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title% (%most_recent_run_time%)" warn=>0
alias_service = checkServiceState CheckAll
alias_service_ex = checkServiceState CheckAll "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc
alias_up = checkUpTime MinWarn=1d MinWarn=1h
alias_updates = check_updates -warning 0 -critical 0
alias_volumes = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED
alias_volumes_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED ignore-unreadable
default =

; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = true

allow nasty characters = false
insecure = true
encoding = utf8

Test remote access with the plugins files::

/usr/lib/nagios/plugins/check_nrpe -H -t 9 -u -c check_load

Alignak configuration

For a Linux monitored host, you simply have to tag the concerned host with the template ``linux-nrpe``.

define host{
use linux-nrpe
host_name linux_nrpe

For a Windows monitored host, you simply have to tag the concerned host with the template ``windows-nrpe``.

define host{
use windows-nrpe
host_name windows_nrpe

Bugs, issues and contributing

Contributions to this project are welcome and encouraged ... `issues in the project repository <>`_ are the common way to raise an information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alignak_checks_nrpe-2.0.2.tar.gz (25.9 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page