User Guide

NRPE

The nep-nrpe-base package provides support for implementing agentless basic monitoring. With nep-nrpe-base it is possible to perform standard monitoring of:

  • Linux servers

  • Winodws servers

Using the objects provided, it is possible:

Perform basic check based on NRPE (CPU load, memory usage, disk space usage, swap usage, server uptime)

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.23+

NetEye modules

Core

Package requirements

Service and Host Template shipped with package nep-nrpe-base require the following nep:

  • nep-common

The Package require the installation of following packages:

  • compat-openssl10.x86_64

  • libnsl.x86_64

On NetEye environment this operation is automatically done by Setup Routine. Check and add the port 5666 in the firewall configuration on the public interface:

firewall-cmd --get-active-zones
firewall-cmd --zone=public --add-port=5666/tcp --permanent
firewall-cmd --reload

Setup instructions

If all requirements are met, you can now install this package. To manually set up the nep-nrpe-base package, just use nep-setup utility to install it.

nep-setup install nep-nrpe-base

Setup On the Linux Client

yum install epel-release
yum --enablerepo=epel -y install nrpe nagios-plugins
systemctl enable nrpe.service
systemctl start nrpe.service

Check that the NRPE service is in a running state and listening on port 5666:

netstat -anop | grep nrpe
tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      13542/nrpe           off (0.00/0/0)
tcp6       0      0 :::5666                 :::*                    LISTEN      13542/nrpe           off (0.00/0/0)

Edit configuration file:

vim /etc/nagios/nrpe.cfg

Add the subnet to the configuration file:

allowed_hosts=127.0.0.1,::1,[YOUR SUBNET, ie: 192.168.1.0]

Ensure that the ‘dont_blame_nrpe’ is set to 1 to accept the NRPE parameters:

dont_blame_nrpe=1

The default commands do not accept parameters, so the following NEP-compatible commands must be added:

command[nx_check_load]=/usr/lib64/nagios/plugins/check_load $ARG1$
command[nx_check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
command[nx_check_swap]=/usr/lib64/nagios/plugins/check_swap $ARG1$
command[nx_check_mem]=/usr/lib64/nagios/plugins/check_mem $ARG1$
command[nx_check_users]=/usr/lib64/nagios/plugins/check_users $ARG1$ $ARG2$
command[nx_check_cpu_stats]=/usr/lib64/nagios/plugins/check_cpu_stats.sh $ARG1$
command[nx_check_mem]=/usr/lib64/nagios/plugins/custom_check_mem -n $ARG1$
command[nx_check_init_service]=sudo /usr/lib64/nagios/plugins/check_init_service $ARG1$
command[nx_check_services]=/usr/lib64/nagios/plugins/check_services -p $ARG1$
command[nx_check_yum]=/usr/lib64/nagios/plugins/check_yum
command[nx_check_apt]=/usr/lib64/nagios/plugins/check_apt
command[nx_check_all_procs]=/usr/lib64/nagios/plugins/custom_check_procs
command[nx_check_procs]=/usr/lib64/nagios/plugins/check_procs $ARG1$
command[nx_check_open_files]=/usr/lib64/nagios/plugins/check_open_files.pl $ARG1$
command[nx_check_netstat]=/usr/lib64/nagios/plugins/check_netstat.pl -p $ARG1$ $ARG2$

Save, Exit and then restart the service:

systemctl restart nrpe.service
systemctl status nrpe.service

● nrpe.service - Nagios Remote Program Executor
    Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
    Active: active (running) since Fri 2022-08-05 17:12:10 CEST; 8s ago
    Docs: http://www.nagios.org/documentation
    Process: 13607 ExecStopPost=/bin/rm -f /run/nrpe/nrpe.pid (code=exited, status=0/SUCCESS)
    Main PID: 13609 (nrpe)
    CGroup: /system.slice/nrpe.service
       └─13609 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f

    Aug 05 17:12:10 centos7-test systemd[1]: Started Nagios Remote Program Executor.
    Aug 05 17:12:10 centos7-test nrpe[13609]: Starting up daemon
    Aug 05 17:12:10 centos7-test nrpe[13609]: Server listening on 0.0.0.0 port 5666.
    Aug 05 17:12:10 centos7-test nrpe[13609]: Server listening on :: port 5666.
    Aug 05 17:12:10 centos7-test nrpe[13609]: Listening for connections on port 5666
    Aug 05 17:12:10 centos7-test nrpe[13609]: Allowing connections from: 127.0.0.1,::1,192.168.1.0/24

Setup On the Windows Client

Download and Install the NSCP++ Agent NSCP-0.5.2.35-x64.msi (https://nsclient.org/download/)

Edit the config file for NSCP++ (C:Program FilesNSClient++nsclient.ini)

# If you want to fill this file with all available options run the following command:
#   nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
#   nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help

; in flight - TODO
[/settings/default]

; Undocumented key
#Password for access to local web server used for configuration of NSCP++
password = xxxxxxx

; Undocumented key
allowed hosts = 127.0.0.1,[YOUR SUBNET OR NETEYE SERVER, ie: 192.168.1.0]/24

; in flight - TODO
[/settings/NRPE/server]
allowed hosts=127.0.0.1,[YOUR SUBNET OR NETEYE SERVER, ie: 192.168.1.0]/24
allow arguments=true
allow nasty characters=true
insecure=true

; Undocumented key
verify mode = none

; Undocumented key
insecure = true

; in flight - TODO
[/modules]

; Undocumented key
CheckExternalScripts = enabled

; Undocumented key
CheckHelpers = enabled

; Undocumented key
CheckNSCP = enabled

; Undocumented key
CheckDisk = enabled

; Undocumented key
WEBServer = enabled

; Undocumented key
CheckSystem = enabled

; Undocumented key
NSClientServer = enabled

; Undocumented key
CheckEventLog = enabled

; Undocumented key
NSCAClient = enabled

; Undocumented key
NRPEServer = enabled
CheckWMI = enabled
CheckLogFile = enabled
SimpleFileWriter = enabled
SimpleCache = enabled

; SyslogClient - Forward information as syslog messages to a syslog server
SyslogClient = enabled

; NRPEClient - NRPE client can be used both from command line and from queries to check remote systes via NRPE as well as configure the NRPE server
NRPEClient = enabled

; NRDPClient - NRDP client can be used both from command line and from queries to check remote systes via NRDP
NRDPClient = enabled

; DotnetPlugin - Plugin to load and manage plugins written in dot net.
DotnetPlugins = enabled

; CommandClient - A command line client, generally not used except with "nscp test".
CommandClient = enabled

; CheckNet - Network related check such as check_ping.
CheckNet = enabled

; Scheduler - Use this to schedule check commands and jobs in conjunction with for instance passive monitoring through NSCA
Scheduler = enabled

; Op5Client - Client for connecting nativly to the Op5 Nortbound API
Op5Client = enabled

; SMTPClient - SMTP client can be used both from command line and from queries to check remote systes via SMTP
SMTPClient = enabled

; LUAScript - Loads and processes internal Lua scripts
LUAScript = enabled

; PythonScript - Loads and processes internal Python scripts
PythonScript = enabled

; GraphiteClient - Graphite client can be used to submit graph data to a graphite graphing system
GraphiteClient = enabled

; CheckTaskSched - Check status of your scheduled jobs.
CheckTaskSched = enabled

; NSCAServer - A server that listens for incoming NSCA connection and processes incoming requests.
NSCAServer = enabled

# Section for WEB (WEBServer.dll) (check_WEB) protocol options.
[/settings/WEB/server]
allowed hosts = 127.0.0.1,[YOUR SUBNET, ie: 192.168.1.0]/24
cache allowed hosts = true
certificate = ${certificate-path}/certificate.pem
port = 8443
threads = 10

; Script wrappings - A list of templates for defining script commands. Enter any command line here and they will be expanded by scripts placed under the wrapped scripts section. %SCRIPT% will be replaced by the actual script an %ARGS% will be replaced by any given arguments.
[/settings/external scripts/wrappings]

; Batch file - Command used for executing wrapped batch files
bat = scripts\\%SCRIPT% %ARGS%

; Visual basic script - Command line used for wrapped vbs scripts
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

; POWERSHELL WRAPPING - Command line used for executing wrapped ps1 (powershell) scripts
ps1 = cmd /c echo If (-Not (Test-Path "scripts\%SCRIPT%") ) { Write-Host "UNKNOWN: Script `"%SCRIPT%`" not found."; exit(3) }; scripts\%SCRIPT% $ARGS$; exit($lastexitcode) | powershell.exe /noprofile -command -

In this example of the configuration file, all modules including the web server have been activated! Ensure that port 5666 is open.

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

This package contains the following Director Objects:

Data Lists

Datalist name

Description

[NX] NRPE Target Type

Used to list the types of operating systems and discriminate the type of agent to be used

Host Templates

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

Host Template name

Description

nx-ht-server-agentless-nrpe

Generic NRPE object.

nx-ht-server-agentless-nrpe-linux

Generic NRPE Linux Host Template

nx-ht-server-agentless-nrpe-windows

Generic NRPE Windows Host Template

nx-ht-server-agentless-nrpe-windows-legacy

Generic NRPE Windows Legacy Host Template

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-agentless-nrpe

[Yes]

Generic Service Template for NRPE

nx-st-agentless-nrpe-linux

[Yes]

Generic Service Template for NRPE Linux

nx-st-agentless-nrpe-linux-check-nrpe

[Yes]

Used for NRPE Version

nx-st-agentless-nrpe-linux-cpu-load

[Yes]

Measures the performances of CPU

nx-st-agentless-nrpe-linux-disk-space-usage

[Yes]

Measuring the Disk space utilisation

nx-st-agentless-nrpe-linux-memory-usage

[Yes]

Measuring the Memory utilisation

nx-st-agentless-nrpe-linux-swap-usage

[Yes]

Measuring swap utilisation

nx-st-agentless-nrpe-linux-uptime

[Yes]

Measures the time of System Uptime

nx-st-agentless-nrpe-windows

[Yes]

Generic Service Template for NRPE Windows

nx-st-agentless-nrpe-windows-counters

[Yes]

Check the specific performance counter

nx-st-agentless-nrpe-windows-cpu-load

[Yes]

Measures the performances of CPU

nx-st-agentless-nrpe-windows-cpu-load-legacy

[Yes]

Measures the performances of CPU

nx-st-agentless-nrpe-windows-disk-space-usage

[Yes]

Measuring the Disk space utilisation

nx-st-agentless-nrpe-windows-disk-space-usage-legacy

[Yes]

Measuring the Disk space utilisation

nx-st-agentless-nrpe-windows-memory-usage

[Yes]

Measuring the Memory utilisation

nx-st-agentless-nrpe-windows-memory-usage-legacy

[Yes]

Measuring the Memory utilisation

nx-st-agentless-nrpe-windows-network

[Yes]

Measuring the Network utilisation

nx-st-agentless-nrpe-windows-os-version

[Yes]

Check the Operating system version

nx-st-agentless-nrpe-windows-pagefile-usage

[Yes]

Measuring swap utilisation

nx-st-agentless-nrpe-windows-process

[Yes]

Check system process

nx-st-agentless-nrpe-windows-service

[Yes]

Check Service state

nx-st-agentless-nrpe-windows-uptime

[Yes]

Measures the time of System Uptime

nx-st-agentless-nrpe-windows-uptime-legacy

[Yes]

Measures the time of System Uptime

nx-st-agentless-nrpe-windows-wmi

[Yes]

Check the specific WMI Query

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-server-agentless-nrpe-linux-basic

Service Set providing common monitoring for Linux-based servers

nx-ss-server-agentless-nrpe-windows-basic

Service Set providing common monitoring for Windows-based servers

nx-ss-server-agentless-nrpe-windows-basic-legacy

Service Set providing common monitoring for Windows-based servers Legacy

Package’s objects list

Object Type

Object Name

Do not edit

Containing File

Director Command

nx-c-check-nrpe

No

baskets/import/nep-nrpe-base-02-command.json

Director Data List

[NX] NRPE Target Type

No

baskets/import/nep-nrpe-base-01-datalist.json

Director Host Template

nx-ht-server-agentless-nrpe-linux

No

baskets/import/nep-nrpe-base-03-host.json

Director Host Template

nx-ht-server-agentless-nrpe

No

baskets/import/nep-nrpe-base-03-host.json

Director Host Template

nx-ht-server-agentless-nrpe-windows-legacy

No

baskets/import/nep-nrpe-base-03-host.json

Director Host Template

nx-ht-server-agentless-nrpe-windows

No

baskets/import/nep-nrpe-base-03-host.json

Director Service Set

nx-ss-server-agentless-nrpe-linux-basic

No

baskets/import/nep-nrpe-base-05-serviceset.json

Director Service Set

nx-ss-server-agentless-nrpe-windows-basic-legacy

No

baskets/import/nep-nrpe-base-05-serviceset.json

Director Service Set

nx-ss-server-agentless-nrpe-windows-basic

No

baskets/import/nep-nrpe-base-05-serviceset.json

Director Service Template

nx-st-agentless-nrpe-linux-check-nrpe

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-linux-cpu-load

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-linux-disk-space-usage

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-linux-memory-usage

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-linux

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-linux-swap-usage

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-linux-uptime

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-counters

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-cpu-load-legacy

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-cpu-load

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-disk-space-usage-legacy

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-disk-space-usage

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-memory-usage-legacy

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-memory-usage

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-network

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-os-version

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-pagefile-usage

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-process

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-service

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-uptime-legacy

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-uptime

No

baskets/import/nep-nrpe-base-04-service.json

Director Service Template

nx-st-agentless-nrpe-windows-wmi

No

baskets/import/nep-nrpe-base-04-service.json