Hello,
We have installed the same but still getting below error:
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_free.py -h
File "./check_dhcp_free.py", line 19
print '\nPySNMP is required for this plugin.'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('\nPySNMP is required for this plugin.')?
[root@HO1-NAGIOSXI libexec]#
[root@HO1-NAGIOSXI libexec]# rpm -q python3-pysnmp
python3-pysnmp-4.4.12-1.el8.noarch
[root@HO1-NAGIOSXI libexec]#
We ran yum install python3-pysnmp command.
DHCP configuration Wizard
Re: DHCP configuration Wizard
Hi,
Since this python script came from Nagios Exchange, we do not support them.
However, I have spent a few hours searching the web and also looking at the "check_dhcp_free" web page and it said to install "pysnmp-2.0.9-3", which is way old and no longer available any where.
https://exchange.nagios.org/directory/P ... ee/details
I looked inside the python script and it used/import the below functions which is no longer used/available in the latest pysnmp-4.x
Sorry, but you will have to find a different one.
Regards,
Vinh
Since this python script came from Nagios Exchange, we do not support them.
However, I have spent a few hours searching the web and also looking at the "check_dhcp_free" web page and it said to install "pysnmp-2.0.9-3", which is way old and no longer available any where.
https://exchange.nagios.org/directory/P ... ee/details
I looked inside the python script and it used/import the below functions which is no longer used/available in the latest pysnmp-4.x
Code: Select all
from pysnmp import asn1, v1, v2c, role
Regards,
Vinh
-
kalyanpabolu
- Posts: 246
- Joined: Fri Jul 03, 2020 4:18 am
Re: DHCP configuration Wizard
Hello,
We have tried a number of options for this but none of them worked.
1. check_dhcp_snmp.pl - this plugin says its deprecated.
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_snmp.pl -H 10.1.0.14 -C 'HO1-CHB-DC2' -w 80 -c 90
Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/share/perl5/vendor_perl/Nagios/Plugin/Functions.pm line 14.
DHCP_SNMP UNKNOWN - bad values: WARN=80 CRIT=90
[root@HO1-NAGIOSXI libexec]#
2. check_dhcp_free.py - this uses old pysnmp version.
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_free.py -h
File "./check_dhcp_free.py", line 19
print '\nPySNMP is required for this plugin.'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('\nPySNMP is required for this plugin.')?
[root@HO1-NAGIOSXI libexec]#
3. check_dhcp_scopes.ps1 - this uses NRPE or NSClinet++
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_scopes.ps1 -h
./check_dhcp_scopes.ps1: line 11: syntax error near unexpected token `newline'
./check_dhcp_scopes.ps1: line 11: `Param ('
[root@HO1-NAGIOSXI libexec]#
I am now really confused which one to check now. We also checked the DHCP Configuration Wizard but it is asking for many details like ethernet and all.
We just wanted to monitor the DHCP Windows servers if the DHCP scope is full or it is not releasing IPs.
Could you please suggest any method from your end?
We have tried a number of options for this but none of them worked.
1. check_dhcp_snmp.pl - this plugin says its deprecated.
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_snmp.pl -H 10.1.0.14 -C 'HO1-CHB-DC2' -w 80 -c 90
Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/share/perl5/vendor_perl/Nagios/Plugin/Functions.pm line 14.
DHCP_SNMP UNKNOWN - bad values: WARN=80 CRIT=90
[root@HO1-NAGIOSXI libexec]#
2. check_dhcp_free.py - this uses old pysnmp version.
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_free.py -h
File "./check_dhcp_free.py", line 19
print '\nPySNMP is required for this plugin.'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('\nPySNMP is required for this plugin.')?
[root@HO1-NAGIOSXI libexec]#
3. check_dhcp_scopes.ps1 - this uses NRPE or NSClinet++
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_scopes.ps1 -h
./check_dhcp_scopes.ps1: line 11: syntax error near unexpected token `newline'
./check_dhcp_scopes.ps1: line 11: `Param ('
[root@HO1-NAGIOSXI libexec]#
I am now really confused which one to check now. We also checked the DHCP Configuration Wizard but it is asking for many details like ethernet and all.
We just wanted to monitor the DHCP Windows servers if the DHCP scope is full or it is not releasing IPs.
Could you please suggest any method from your end?
Re: DHCP configuration Wizard
Hi,
I looked at your "check_dhcp_snmp.py" error (below) from you last replied:
There are couple things you must do:
#1) Edit "check_dhcp_snmp.py" and changed from using "Nagios::Plugin" to "Nagios::Monitoring::Plugin" lines 34,35, 37 and 39 (below).
NOTE: Please do not include the line number as showed below. They are there just for easy reading:
From:
To:
#2) The value of "w" must be greater than "c", Here's what stated inside the script:
As you can see from above, "( $CRIT < $WARN )" ... "c" must be less than "w", which is why you get "UNKNOWN, bad values" error.
Can you please try the "check_dhcp_snmp.py" script again?
The correct syntax is:
-w, --warning=INTEGER
Minimum percent free leases for status WARNING
-c, --critical=INTEGER
Minimum percent free leases for status CRITICAL
Regards,
Vinh
I looked at your "check_dhcp_snmp.py" error (below) from you last replied:
Code: Select all
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_snmp.pl -H 10.1.0.14 -C 'HO1-CHB-DC2' -w 80 -c 90
Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/share/perl5/vendor_perl/Nagios/Plugin/Functions.pm line 14.
DHCP_SNMP UNKNOWN - bad values: WARN=80 CRIT=90
#1) Edit "check_dhcp_snmp.py" and changed from using "Nagios::Plugin" to "Nagios::Monitoring::Plugin" lines 34,35, 37 and 39 (below).
NOTE: Please do not include the line number as showed below. They are there just for easy reading:
From:
Code: Select all
34 use Nagios::Plugin;
35 use Nagios::Plugin::Getopt;
36
37 my $np = Nagios::Plugin->new;
38
39 my $ng = Nagios::Plugin::Getopt->new(
Code: Select all
34 use Nagios::Monitoring::Plugin;
35 use Nagios::Monitoring::Plugin::Getopt;
36
37 my $np = Nagios::Monitoring::Plugin->new;
38
39 my $ng = Nagios::Monitoring::Plugin::Getopt->new(
Code: Select all
unless ( ( 0 < $CRIT ) && ( $CRIT < $WARN ) && ( $WARN < 100 ) ) {
$np->nagios_exit( UNKNOWN, "bad values: WARN=$WARN CRIT=$CRIT" );
}
Can you please try the "check_dhcp_snmp.py" script again?
The correct syntax is:
Code: Select all
./check_dhcp_snmp.pl -H 10.1.0.14 -C 'HO1-CHB-DC2' -w 8 -c 5
Minimum percent free leases for status WARNING
-c, --critical=INTEGER
Minimum percent free leases for status CRITICAL
Regards,
Vinh
-
kalyanpabolu
- Posts: 246
- Joined: Fri Jul 03, 2020 4:18 am
Re: DHCP configuration Wizard
Hello,
Thanks for your help!!
We were able to get some output:
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_snmp.pl -H 10.1.0.14 -C 'HO1-CHB-DC2' -w 8 -c 5
DHCP_SNMP CRITICAL - One or more scopes is nearing capacity
Critical:10.1.0.0 - 0% free - 41/41
OK:10.1.140.0 - 100% free - 0/1018
OK:10.1.8.0 - 98% free - 5/250
OK:10.1.1.0 - 62% free - 92/248
OK:10.1.2.0 - 69% free - 64/212
OK:10.1.144.0 - 100% free - 0/1018
OK:10.1.148.0 - 98% free - 4/250
OK:10.1.92.0 - 92% free - 11/150
OK:10.1.80.0 - 93% free - 69/1021
OK:10.1.3.0 - 79% free - 41/199
OK:10.1.72.0 - 94% free - 117/2042
OK:10.161.1.0 - 89% free - 21/200
OK:10.3.39.0 - 72% free - 12/43
OK:172.16.10.0 - 11% free - 54/61
[root@HO1-NAGIOSXI libexec]#
I will get back to you with the updates.
Thanks for your help!!
We were able to get some output:
[root@HO1-NAGIOSXI libexec]# ./check_dhcp_snmp.pl -H 10.1.0.14 -C 'HO1-CHB-DC2' -w 8 -c 5
DHCP_SNMP CRITICAL - One or more scopes is nearing capacity
Critical:10.1.0.0 - 0% free - 41/41
OK:10.1.140.0 - 100% free - 0/1018
OK:10.1.8.0 - 98% free - 5/250
OK:10.1.1.0 - 62% free - 92/248
OK:10.1.2.0 - 69% free - 64/212
OK:10.1.144.0 - 100% free - 0/1018
OK:10.1.148.0 - 98% free - 4/250
OK:10.1.92.0 - 92% free - 11/150
OK:10.1.80.0 - 93% free - 69/1021
OK:10.1.3.0 - 79% free - 41/199
OK:10.1.72.0 - 94% free - 117/2042
OK:10.161.1.0 - 89% free - 21/200
OK:10.3.39.0 - 72% free - 12/43
OK:172.16.10.0 - 11% free - 54/61
[root@HO1-NAGIOSXI libexec]#
I will get back to you with the updates.