Page 1 of 2

SNMP monitoring on Ubuntu

Posted: Wed Aug 18, 2021 2:41 pm
by gvrjameskyaw
Received this error message while trying to monitor disk usage on Ubuntu 16.04.7 LTS server
ERROR: Description/Type table : No response from remote host '10.80.72.115'.
Service Command
check_xi_service_snmp_linux_storage! -C public --v2c -m "^/$" -w 80 -c 95 -f

Re: SNMP monitoring on Ubuntu

Posted: Thu Aug 19, 2021 12:11 pm
by pbroste
Hello @gvrjameskyaw

Thanks for reaching out, and want to go ahead and verify that ports 161 and 162 are allowed. Also verify that security applications like selinux are blocking.

Verify results by running this command:

Code: Select all

snmpwalk -c <yourcommunitystring> -v 2c <youripaddress>
We expect to see results that look similar to:
SNMPv2-MIB::sysORDescr.8 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB modules for managing SNMP Notification, plus filtering.
SNMPv2-MIB::sysORDescr.10 = STRING: The MIB module for logging SNMP Notifications.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
Please let us know the results,
Perry

Re: SNMP monitoring on Ubuntu

Posted: Wed Aug 25, 2021 11:30 am
by gvrjameskyaw
Hi Perry,

Is it TCP or UDP 161 and 162? Also, only inbound traffic on destination IP?
The result I received after running snmpwalk -c communitystring -v 2c destination ip is "Timeout: No Response from 10.28.8.78"
Thanks
pbroste wrote:Hello @gvrjameskyaw

Thanks for reaching out, and want to go ahead and verify that ports 161 and 162 are allowed. Also verify that security applications like selinux are blocking.

Verify results by running this command:

Code: Select all

snmpwalk -c <yourcommunitystring> -v 2c <youripaddress>
We expect to see results that look similar to:
SNMPv2-MIB::sysORDescr.8 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB modules for managing SNMP Notification, plus filtering.
SNMPv2-MIB::sysORDescr.10 = STRING: The MIB module for logging SNMP Notifications.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
Please let us know the results,
Perry

Re: SNMP monitoring on Ubuntu

Posted: Wed Aug 25, 2021 2:23 pm
by pbroste
Hello @gvrjameskyaw

SNMP uses UDP port 161 and port 162.

Please let us know if you need anything further,
Perry

Re: SNMP monitoring on Ubuntu

Posted: Wed Aug 25, 2021 2:37 pm
by gvrjameskyaw
So for firewall request it would look like...

Nagios XI server ==> open UDP 161, 162 ==> destination host.

Is there any need to open inbound ports on the Nagios server also?

Thanks

Re: SNMP monitoring on Ubuntu

Posted: Wed Aug 25, 2021 4:06 pm
by gsmith
Hi,

Nope, no changes are needed on the Nagios XXI server.

Thanks

Re: SNMP monitoring on Ubuntu

Posted: Thu Aug 26, 2021 12:27 pm
by gvrjameskyaw
When I try to monitor Disk Usage on Ubuntu server using SNMP
check_xi_service_snmp_linux_storage! -C public --v2c -m "^/$" -w 80 -c 95 -f

I got this error Unknown storage : ^/$ : ERROR

Re: SNMP monitoring on Ubuntu

Posted: Fri Aug 27, 2021 11:14 am
by gsmith
Hi

From looking at the help for that plugin it shows:
example :
Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v
the -m option allows regexp in perl format :
Test drive C,F,G,H,I on Windows : -m ^[CFGHI]:
Test all mounts containing /var : -m /var
Test all mounts under /var : -m ^/var
Test only /var : -m /var -r
Test all swap spaces : -m ^Swap
Test all but swap spaces : -m ^Swap -e
So try removing the quotes around the argument to the -m option:
check_xi_service_snmp_linux_storage! -C public --v2c -m ^/$ -w 80 -c 95 -f

Thanks

Re: SNMP monitoring on Ubuntu

Posted: Tue Aug 31, 2021 3:52 pm
by gvrjameskyaw
Still getting Unknown storage : ^/var : ERROR

check_xi_service_snmp_linux_storage! -C public --v2c -m ^/var -w 80 -c 95 -f

Re: SNMP monitoring on Ubuntu

Posted: Wed Sep 01, 2021 9:37 am
by gsmith
Hi,

Please change the ^/var to ^/$ (that's a dollar sign not an S).

Here is the command and the output:

Code: Select all

[nagios@gs-cent8-23-82 ~]$ /usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H 192.168.23.93 -C public --v2c -m ^/$ -w 80 -c 95 -f
/: 26%used(6208MB/23555MB) (<80%) : OK | '/'=6208MB;18844;22378;0;23555
Thank you