Page 1 of 1

check_UDP

Posted: Tue Jul 07, 2020 9:18 am
by progressive.nagiosXI
Hi

Please help to Configure Device Availability monitoring via UDP port. (ping is not enabled ,only snmp enabled)

Device type switch ,router ,firewall , linux servers etc

Code: Select all

[root@monitoring-nagiosxi ~]# /usr/local/nagios/libexec/check_udp -H 10.100.1.16 -p 161 -s "string" -e "expected string"
CRITICAL - Socket timeout
[root@monitoring-nagiosxi ~]# /usr/local/nagios/libexec/check_udp -H 10.100.1.16 -p 161 -s "snmp" -e "snmp"
CRITICAL - Socket timeout

Ex:- we install snmp in nagios server via net-snmp and snmp is working,So what is string and expected string here ,how to find these string names.

and also help to know same for other network devices(switch,router,firewall).

Code: Select all

'
     -s, --send=STRING
        String to send to the server // ?? from where or how to find this
     -e, --expect=STRING
        String to expect in server response (may be repeated)  // ?? from where or how to find this
we checked with check_udp_port its working fine but no parameter found for graph generation,Device response time value for graph etc .
https://exchange.nagios.org/directory/P ... rt/details

Code: Select all

[root@monitoring-nagiosxi ~]# ./check_udp_port -H 10.100.1.16 -p 161 -s snmp
OK: snmp listening on port 161: 161/udp open snmp
[root@monitoring-nagiosxi ~]# echo $?
0
[root@monitoring-nagiosxi ~]# ./check_udp_port -H 10.100.1.26 -p 161 -s snmp
CRITICAL:
[root@monitoring-nagiosxi ~]# echo $?
2
[root@monitoring-nagiosxi ~]# ./check_udp_port -H 10.100.1.16 -p 161 -s snmp1
WARNING: Incorrect service snmp listening on port 161: 161/udp open snmp
[root@monitoring-nagiosxi ~]# echo $?
1
from check_udp or check_udp_port which is good for Host availability monitoring.

Thanks

Re: check_UDP

Posted: Tue Jul 07, 2020 2:50 pm
by scottwilkerson
If you just need to validate the name of the service listening on a port then i

Code: Select all

check_udp_port[/icode] will do the job just fine

If you need to send a specific string to the port and get an expected result, then [icode]check_udp[/icode] would work, however, you need to know what string to send to the UDP port and what you expect to get back.

[quote="progressive.nagiosXI"]we checked with check_udp_port its working fine but no parameter found for graph generation,Device response time value for graph etc .[/quote]

When you are just monitoring if the port is listening or not, there isn't much to graph and this plugin doesn't return graphing data.  Especially because of the way UDP operates, it isn't returning any sort of response time.

If you needed to graph some metric, you would need to modify the plugin to return whatever data you needed to be graphed in the performace data format
[url]https://nagios-plugins.org/doc/guidelines.html#AEN200[/url]

Re: check_UDP

Posted: Tue Jul 07, 2020 3:25 pm
by progressive.nagiosXI
Hi scott,

Thanks for update
If you need to send a specific string to the port and get an expected result, then check_udp would work, however, you need to know what string to send to the UDP port and what you expect to get back
How to identify string please describe
Example:- i install snmp in centos7 via net-snmp and configure snmp v2 with community string nagisxi.so what is send string and expect string in this case for check_udp.


Thanks

Re: check_UDP

Posted: Tue Jul 07, 2020 3:43 pm
by scottwilkerson
progressive.nagiosXI wrote: How to identify string please describe
I cannot tell you exactly what the string you would need to pass to port 161 UDP for a SNMP request actually, I've never needed to, BUT if you had a different program and you knew what to pass, and what you expected to get as a response back, then you could use this.

Re: check_UDP

Posted: Tue Jul 07, 2020 3:47 pm
by scottwilkerson
Let me take this one step further, lets pretend this was a TCP server on port 25 (a SMTP server), you could connect via telnet and test it,

in the example in the link below the send string would be EHLO test.example.com and you could expect it to return 250-mail.example.com

https://www.thomas-krenn.com/en/wiki/Te ... ith_telnet