DHCP Monitoring

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: DHCP Monitoring

Post by tgriep »

Generic guide for NSClient++.

Code: Select all

https://docs.nsclient.org/tutorial/
Here is a guide on creating external commands on NSClient.

Code: Select all

https://docs.nsclient.org/howto/external_scripts/
After installing NSClient++.
Copy the visual basic script to this folder
C:\Program Files\NSClient++\scripts

Create a command in the nsclient.ini file like this example.

Code: Select all

check_dhcp_scope = cscript.exe //T:115 //NoLogo scripts\\check_dhcp_scope.vbs
Put it under this section
[/settings/external scripts/scripts]

After installing the check_nrpe plugin on the Nagios server, create a command for it like this.

Code: Select all

define command {
    command_name    check_nrpe
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$
}

An example service command to run the external command check_dhcp_scope on the remote windows server.

Code: Select all

define service {
    host_name                WindowsHost
    service_description      Check DHCP nrpe
    use                      local-service
    check_command            check_nrpe!!check_dhcp_scope!!!!!!
    max_check_attempts       5
    check_interval           5
    retry_interval           1
    notification_period      24x7
    notification_options     w,c,u,r,s,
    notifications_enabled    1
    contacts                 nagiosadmin
    register                 1
}
There really in not a guide for creating specific commands for the plugins you want to run so you will have to do the research on settings this up for your needs.
Do some searching here.
https://support.nagios.com/kb/category.php?id=10
https://support.nagios.com/kb/category.php?id=12
https://assets.nagios.com/downloads/nag ... n/toc.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
skypete
Posts: 98
Joined: Sat Dec 02, 2017 11:44 pm

Re: DHCP Monitoring

Post by skypete »

That worked. Thanks could you please explain in detail on how to check_dhcp_all_pools.sh working.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: DHCP Monitoring

Post by tgriep »

The author of the plugin could provide more details than I but the plugin looks to poll the Windows server using SNMP to gather the number of free address, the number of used addresses and the total number of addresses and use that to calculate used, free and generate an alert if the percentage of free falls below the threshold settings.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked