Page 2 of 2

Re: DHCP Monitoring

PostPosted: Wed Apr 10, 2019 11:51 am
by tgriep
Generic guide for NSClient++.
Code: Select all

Here is a guide on creating external commands on NSClient.
Code: Select all

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.

Re: DHCP Monitoring

PostPosted: Wed Apr 10, 2019 12:59 pm
by skypete
That worked. Thanks could you please explain in detail on how to working.

Re: DHCP Monitoring

PostPosted: Wed Apr 10, 2019 2:25 pm
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.