used/free ips per scope on the DHCP Server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: used/free ips per scope on the DHCP Server

Post by grayloglearn »

We could able to monitor the single dhcp scope now. Can you help on the below query's pls.

1) Can you please tell us do we have some other options or ways to enable the dhcp scope monitoring instead of using script??
2) As i heard that we can enable scopes monitoring with SNMP, as you said SNMP feature is removed from windows server 2016 but i could see the snmp service feature in "add roles and feature in windows server 2016. Can you tell me as you told which feature is removed in windows server 2016 standard edition to enable the scope monitoring??
3) Does any special feature is removed which helps to monitor the scopes?? If its removed can you tell me what is the feature name pls.
5. You can monitor DHCP scope states with SNMP, for Windows Server 2012 and below. Server 2016 and newer, Microsoft has removed this feature. I would recommend against monitoring DHCP with SNMP, even if you are currently running Server 2012 or lower, simply because eventually you will upgrade the DHCP server, and you will just have to deal with this problem when that happens. Though, if you did go this route, it would buy you time to build a more robust, and maintainable solution.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: used/free ips per scope on the DHCP Server

Post by mbellerue »

The general SNMP service is still available in Windows, but specifically SNMP for monitoring the DHCP service is removed. We have confirmed this with a couple of other customers who had been trying to monitor DHCP on a Server 2016 machine via SNMP.

Since your DHCP server is on Windows Server 2012, SNMP monitoring is an option for you. But you have to take into account that when you upgrade the server, the SNMP option will go away, and you will need a new way to monitor DHCP.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: used/free ips per scope on the DHCP Server

Post by grayloglearn »

thanks for the replay,

Can some one replay on below issue
we are getting the error while we are trying to monitoring individual.
The below is the line we have added in nsclient.ini

check_DHCP_perscope = powershell.exe -command C:\Program` Files\NSClient++\scripts\check_DHCP_perscope.ps1 -s $ARG1$

The below is the error while we are calling from the nagios.
root@ip-172-31-40-170:~# /usr/local/nagios/libexec/check_nrpe -H 172.31.41.228 -t 120 -c check_DHCP_perscope -a 192.168.1.0
At C:\Program Files\NSClient++\scripts\check_DHCP_perscope.ps1.ps1:97 char:2
+ |'break
+ ~
An'=0 'empty'=0 'pipe'=0 'element'=0 'is'=0 'not'=0 'allowed.
'=0 '+'=0 'CategoryInfo'=0 ':'=0 'ParserError:'=0 '(:)'=0 '[],'=0 'ParseException
'=0 '+'=0 'FullyQualifiedErrorId'=0 ':'=0 'EmptyPipeElement'=0
root@ip-172-31-40-170:~#
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: used/free ips per scope on the DHCP Server

Post by mbellerue »

That looks like the check_DHCP_perscope.ps1 file may have been accidentally altered. Can you open up that file on the remote server in Powershell ISE, and take a screenshot of the code around line 97?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: used/free ips per scope on the DHCP Server

Post by grayloglearn »

Hi Team,

We are using the below script to get the scope details.
---------------------------------
foreach ($Scope in Get-DhcpServerv4ScopeStatistics)
{
    "OK: scopeID=$($scope.scopeid) |" + " Scope is $($scope.percentageinuse)% used;" + " free_ips=$($scope.free);" + " used_ips=$($scope.inuse);"
}
--------------------------------

if we use this script we are getting output in windows server but in nagios we are getting only below output. Could you please help on that.

root@ip-172-31-40-170:~# /usr/local/nagios/libexec/check_nrpe -H ip-172-31-41-228.ec2.internal -t 120 -c kannan
OK: scopeID=192.168.1.0 |'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=3 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=5 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=8 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=11 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=4 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=4 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=3 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=6 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=3 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=4 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=5 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=4 'used_ips'=0;0 'scopeID'=0 '|'=0 'Scope'=0 'is'=0 '0%'=0 'used'=0 'free_ips'=3 'us

And Could you please share the powershell plugin guidelines.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: used/free ips per scope on the DHCP Server

Post by mbellerue »

This looks like the same problem as the other script had. It's just too much data for NSClient's implementation of NRPE. I think the only options here are to go to NCPA, or have several service checks, each checking a set of DHCP scopes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: used/free ips per scope on the DHCP Server

Post by grayloglearn »

Hi Team,

Can you please reply on this do we have any separate guidelines to powershell plugin ?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: used/free ips per scope on the DHCP Server

Post by benjaminsmith »

Hello @Grayloglearn,

You can write a plugin in any programming language, as a result, we don't have separate documentation based on language. Here are the requirements:

Nagios Plugins Development Guidelines
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked