SNMP monitoring on Ubuntu

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gvrjameskyaw
Posts: 7
Joined: Tue Aug 17, 2021 2:38 pm

SNMP monitoring on Ubuntu

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: SNMP monitoring on Ubuntu

Post 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
gvrjameskyaw
Posts: 7
Joined: Tue Aug 17, 2021 2:38 pm

Re: SNMP monitoring on Ubuntu

Post 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
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: SNMP monitoring on Ubuntu

Post by pbroste »

Hello @gvrjameskyaw

SNMP uses UDP port 161 and port 162.

Please let us know if you need anything further,
Perry
gvrjameskyaw
Posts: 7
Joined: Tue Aug 17, 2021 2:38 pm

Re: SNMP monitoring on Ubuntu

Post 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
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: SNMP monitoring on Ubuntu

Post by gsmith »

Hi,

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

Thanks
gvrjameskyaw
Posts: 7
Joined: Tue Aug 17, 2021 2:38 pm

Re: SNMP monitoring on Ubuntu

Post 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
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: SNMP monitoring on Ubuntu

Post 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
gvrjameskyaw
Posts: 7
Joined: Tue Aug 17, 2021 2:38 pm

Re: SNMP monitoring on Ubuntu

Post by gvrjameskyaw »

Still getting Unknown storage : ^/var : ERROR

check_xi_service_snmp_linux_storage! -C public --v2c -m ^/var -w 80 -c 95 -f
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: SNMP monitoring on Ubuntu

Post 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
Locked