Hi all,
First of all this is an all Linux environment (we have a couple of FreeBSD machines too).
I'm trying to develop a plugin that will collect the BMC temperatures for inlet & outlet from our servers. I can successfully retrieve this with ipmitool when logged in as root.
It is my understanding that plugin scripts (for us in /usr/lib64/nagios/plugins) are run on remote machines as user nrpe (in our case). This will not allow access to the ipmitool (or more precisely, won't allow access to /dev/ipmi0, which is only accessible by root).
What would be the best way around this?
Alternately if there is another plugin (or method) that someone can suggest that would do the job.
Cheers.
Phill.
Newbie plugin question....
Re: Newbie plugin question....
Hello @PhillHS,
I found this resource for setting up plugins to run as root: viewtopic.php?t=33959. It looks like this article that they link to lists out the main options for running plugins as root: https://your-linux-how-tos.blogspot.com ... -root.html --
I found this resource for setting up plugins to run as root: viewtopic.php?t=33959. It looks like this article that they link to lists out the main options for running plugins as root: https://your-linux-how-tos.blogspot.com ... -root.html --
Option Three (Best):
Give the nagios user sudo access to run one command in this example the command is "lsof" and add "sudo" in the plugin script before the command you want to run.
# Add nagios to sudoers
vi /etc/sudoers
# nagios check (/usr/lib/nagios/plugins/check_user_openfiles)
nagios ALL=NOPASSWD: /bin/lsof
# In your script add "sudo" before the command.
sudo lsof | grep blah
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.