Page 3 of 3

Re: Passive check configuration with ncpa and nsca

Posted: Thu Feb 13, 2020 10:13 pm
by grayloglearn
we have seen that check_nt is having some limitations so that you suggest on check_ncpa.
Now if i run the command check_nt with different scopes i am able to get the data. Please find the below.

[nagios@nagiu ~]$ /usr/local/nagios/libexec/check_nrpe -H XXXX -t 120 -c check_DHCP_perscope -a 172.31.113.0,172.31.112.0,172.31.114.0,172.31.115.0,172.31.116.0
OK: 38-scope-data Vlan 420 in good order. 38-scope-data Vlan 420 is 47% used, (104 leases, 116 IP's available.) |'FreeIPS'=116 'LeaseIPS'=104;0 '38-scope-Level3-Data'=0 'Vlan'=0 '310'=0 'in'=0 'good'=0 'order.'=0 '38-scope-Level3-Data'=0 'Vlan'=0 '310'=0 'is'=0 '88%'=0 'used,'=0 '(193'=0 'leases,'=0 '27'=0 'IP's'=0 'available.)'=0 '|'=0 'FreeIPS'=27 'LeaseIPS'=193;0 '38-scope-Level4-Data'=0 'Vlan'=0 '410'=0 'in'=0 'good'=0 'order.'=0 '38-scope-Level4-Data'=0 'Vlan'=0 '410'=0 'is'=0 '78%'=0 'used,'=0 '(171'=0 'leases,'=0 '49'=0 'IP's'=0 'available.)'=0 '|'=0 'FreeIPS'=49 'LeaseIPS'=171;0 '38-scope-LevelG-Voice'=0 'Vlan'=0 '520'=0 'in'=0 'good'=0 'order.'=0 '38-scope-LevelG-Voice'=0 'Vlan'=0 '520'=0 'is'=0 '0%'=0 'used,'=0 '(0'=0 'leases,'=0 '220'=0 'IP's'=0 'available.)'=0 '|'=0 'FreeIPS'=220 'LeaseIPS'=0;0 '38-scope-Level5-Data'=0 'Vlan'=0 '510'=0 'in'=0 'good'=0 'order.'=0 '38-scope-Level5-Dat

I thought that ncpa is more capability than nsca. But ncpa is also not giving the output for multiple scopes. I understand you have some limitation but we have to resolve this.

Even if we call "/usr/local/nagios/libexec/check_ncpa.py -H 172.31.94.235 -t Test@123 -P 5693 -M 'plugins/dhcpncpa.ps1' -q "args=-all"


All scopes are not showing in nagios console.

Does ncpa does not have capabilities to call multiple scopes ? or plugin does not have capabilites?

Re: Passive check configuration with ncpa and nsca

Posted: Fri Feb 14, 2020 9:58 am
by lmiltchev
In one of the previous posts you showed us "check_DHCP_perscope" defined this way:

Code: Select all

check_DHCP_perscope = powershell.exe -command C:\Program` Files\NSClient++\scripts\check_DHCP_perscope.ps1 -s $ARG1$
So, is check_DHCP_perscope.ps1 (that you are calling via check_nrpe and NSClient++) and dhcpncpa.ps1 (that you are calling via check_ncpa.py) the SAME script?

Can you upload the script that you are using on the forum?

Re: Passive check configuration with ncpa and nsca

Posted: Sun Feb 16, 2020 8:26 pm
by grayloglearn
Hi team,

Yes, the script is same as you suggest i am working on ncpa instead of nsca as its have some limitation. The script is also same.

Re: Passive check configuration with ncpa and nsca

Posted: Mon Feb 17, 2020 9:52 am
by lmiltchev
Can you upload the script that you are using on the forum?

Re: Passive check configuration with ncpa and nsca

Posted: Mon Feb 17, 2020 8:40 pm
by grayloglearn
Hi Please find the attachment for the script.

Re: Passive check configuration with ncpa and nsca

Posted: Thu Feb 20, 2020 11:11 am
by scottwilkerson
There is a problem with the comma as a seperator in the way NCPA works, but I did create a workaround for you

attached is the text for a slightly modified dhcpncpa.ps1 which uses a semi-colon as a separator

call with

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 172.31.94.235 -t Test@123 -P 5693 -M 'plugins/dhcpncpa.ps1' -q 'args=-s 172.31.113.0;172.31.112.0;172.31.114.0;172.31.115.0;172.31.116.0'