User Tools

Site Tools


running_a_nagios_icinga_plugin_as_root_from_nrpe

Running a Nagios/Icinga plugin as root from NRPE

Problem

In this example case a check of the battery state of an IBM SIS SAS adapter should be implemented.
This check can be performed with the following command (for device sissas0):

$ /usr/bin/sissasraidmgr -M -oO -l sissas0

Result

The problem is that running /usr/bin/sissasraidmgr requires root privileges. Running it as the user nrpe triggered from the Nagios/Icinga server will produce no output due to lack of permissions.

Solution

Give sudo access to the user nrpe to run the command.

1) Install sudo on the AIX/VIOS LPAR.

2) As root user on the AIX/VIOS LPAR run visudo and add these two lines at the end of the file:

# Nagios/Icinga check: allow the 'nrpe' user to run /usr/bin/sissasraidmgr
nrpe ALL=(ALL) NOPASSWD: /usr/bin/sissasraidmgr

3) In the script /opt/freeware/lib/plugins/icinga/check_ibm_sissas.sh (or wherever you have put it) add “/usr/bin/sudo” before the command.

/usr/bin/sudo /usr/bin/sissasraidmgr ...
running_a_nagios_icinga_plugin_as_root_from_nrpe.txt · Last modified: 2018/12/19 12:53 (external edit)