Hi All ,I have the following scenario:
Both Debian jessie
Monitoring server: 192.168.0.200
Client server: 192.168.0.100
Nagios and Nrpe works fine on both servers.Now , i want to monitor some values of iostat on the client server(.100), so i'm runnng the command
#iostat -xm 20 in the background to a file(iostat.txt). Then i have the following on the client server.
#command[check_iostat.php]=tail -100 /usr/lib/nagios/plugins/iostat.txt | tac | grep Device -B2000 -m1 | tac
This gives the following is the output of the command when run on command line.
# tail -100 /usr/lib/nagios/plugins/iostat.txt | tac | grep Device -B2000 -m1 | tac
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sdc 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda 0.00 0.50 0.00 0.70 0.00 0.00 13.71 0.01 8.29 0.00 8.29 8.29 0.58
i only want the values for r/s,w/s,rMB/s,wMB/s,%util on the monitoring server,
i'm pulling the above output.My question is, on the monitoring server , can i create a php script to filter the values i want and present them on Nagios ?
Thank you .
Nrpe custom plugin
Re: Nrpe custom plugin
You certainly could, but I think it would be much better to have the plugin you are executing on the remote machine return the proper Nagios plugin outputs. Here's a link to the documentation for developing a Nagios plugin:simonx wrote:My question is, on the monitoring server , can i create a php script to filter the values i want and present them on Nagios ?
https://nagios-plugins.org/doc/guidelines.html
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Nrpe custom plugin
Thanks.
I have managed to put together the script.
My last question is on how do i do generic configs on the nagios server to cater for about 20 hosts, i'm avoiding doing configs on commands.cfg and services for each of the 20 hosts.
Thanks once again.
I have managed to put together the script.
My last question is on how do i do generic configs on the nagios server to cater for about 20 hosts, i'm avoiding doing configs on commands.cfg and services for each of the 20 hosts.
Thanks once again.
Re: Nrpe custom plugin
One way many users address large configuration sets is to group their hosts into a hostgroup. Then, if those hosts share common check (cpu, disk, memory, etc) you can assign those services to the hostgroup rather than individual hosts. Then, any hosts that are a part of that hostgroup would inherit those services. You could also use a host template to contain things like contacts, check times, check commands, etc.
More information:
https://assets.nagios.com/downloads/nag ... #hostgroup
https://assets.nagios.com/downloads/nag ... tance.html
More information:
https://assets.nagios.com/downloads/nag ... #hostgroup
https://assets.nagios.com/downloads/nag ... tance.html
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Nrpe custom plugin
i have managed to fix the issue.Thank you
Re: Nrpe custom plugin
Glad to hear you've been able to fix the issue. Is it okay to close the thread at this point or did you have any further questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nrpe custom plugin
Please close it , thank you