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
$ /usr/bin/sissasraidmgr -M -oO -l sissas0
The problem is that running
/usr/bin/sissasraidmgr requires root privileges. Running it as the user
triggered from the Nagios/Icinga server will produce no output due to lack of permissions.
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 ...