Hi All,
I wish to graph the number of available DHCP leases over time.
I have managed to find this script
https://exchange.nagios.org/directory/P ... pe/details
and have followed the instructions to get it working.
When I run the command ./check_nrpe -H x.x.x.x -c check_dhcp_scope
I get the standard response which is "1 Scopes OK"
So I looked at the script and activated one of the debug lines and now I can get the following out of the script
"x.x.x.x 80 584"
So, my question is this. How do I format the output from that script so that nagios can track and graph the data over time? Is there any trick or will it just take those numbers, store and graph it?
Thanks in advance,
Chris.
PS. My DHCP server is a standard windows 2012 R2 server. If there are some other scripts / features that will achieve my goal of graphing the DHCP availability I'm willing to give them a try. And I will probably hack that script to that it gives percentage free and used rather than number.
Graphing DHCP Availability
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Graphing DHCP Availability
Performance data is after the pipe | and has to be formatted in a specific way.
https://nagios-plugins.org/doc/guidelines.html#AEN200
I actually did a talk on this at the Nagios World Conference, you can watch it here:
https://www.youtube.com/watch?v=kqA2KcpUFg4
http://www.slideshare.net/nagiosinc/tro ... and-graphs
It has an example bash script that generates performance data, the method is the same in a vbs script, simply add the performance data at the end of the plugin output.
I read through the plugin. The way it's coded is not as elegant/efficient as it could be, which means you need to add it in multiple locations. Just cause I'm a nice guy, here's a modified version which *should* do what you are after. The lines I changed were 71,74,78,96. NOTE: not tested as I don't have a windows DHCP server.
https://nagios-plugins.org/doc/guidelines.html#AEN200
Code: Select all
'label'=value[UOM];[warn];[crit];[min];[max]https://www.youtube.com/watch?v=kqA2KcpUFg4
http://www.slideshare.net/nagiosinc/tro ... and-graphs
It has an example bash script that generates performance data, the method is the same in a vbs script, simply add the performance data at the end of the plugin output.
I read through the plugin. The way it's coded is not as elegant/efficient as it could be, which means you need to add it in multiple locations. Just cause I'm a nice guy, here's a modified version which *should* do what you are after. The lines I changed were 71,74,78,96. NOTE: not tested as I don't have a windows DHCP server.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Graphing DHCP Availability
Hi Box293,
thanks very much for the info. I have modified your script slightly (it didn't like the & at the end of the line) but mostly it's working ok. I've setup the command and service in Nagios and will wait for a bit to see if it starts graphing.
Cheers,
Chris.
(fellow Aussie from Victoria
)
thanks very much for the info. I have modified your script slightly (it didn't like the & at the end of the line) but mostly it's working ok. I've setup the command and service in Nagios and will wait for a bit to see if it starts graphing.
Cheers,
Chris.
(fellow Aussie from Victoria
Re: Graphing DHCP Availability
Let us know. I'll leave this one open for now.stebbo wrote:Hi Box293,
thanks very much for the info. I have modified your script slightly (it didn't like the & at the end of the line) but mostly it's working ok. I've setup the command and service in Nagios and will wait for a bit to see if it starts graphing.
Cheers,
Chris.
(fellow Aussie from Victoria)
Thanks!
Former Nagios Employee.
me.
me.
Re: Graphing DHCP Availability
Hi Box293,
the DHCP graph is working very nicely. Thanks for your assistance.
I have uploaded the vbs script that I'm using to this email in case anyone else is interested. I hacked it to pieces a bit because I only want to graph the number of available leases.
Cheers,
Chris.
the DHCP graph is working very nicely. Thanks for your assistance.
I have uploaded the vbs script that I'm using to this email in case anyone else is interested. I hacked it to pieces a bit because I only want to graph the number of available leases.
Cheers,
Chris.
You do not have the required permissions to view the files attached to this post.