Service.Check

Started by lweidig, April 20, 2022, 10:46:36 PM

Previous topic - Next topic

lweidig

We are working to monitor a number of services that per the manual have cURL support and hence should be using the Service.Check agent command.

We are working to get POP3 working at the moment and have:

Service.Check(pop3://username:[email protected]/,^.*OK Authenticated.*)

If we put in actual values and run this using from the command line using the curl -v command we get valid results.  However, when we run it from a DCI it always comes up with 3.  How can we see the value being returned from the check.  Also, it states the Service.Check.XXXXX are to be considered deprecated in the documentation.  Wondering why since they seem to offer more complete testing of common protocols?

Thanks!

Alex Kirhenshtein

On start agent reports list of protocols supported by libcurl (on debug level 3, I think):

2022.04.21 11:52:37.320 *D* [init.curl          ] cURL supported protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp

Check that you have pop3 available in this list.

lweidig

Unfortunately that does not seem to be the issue.  This is the NetXMS agent on Windows server:


2022.04.21 07:47:13.062 *D* [init.curl          ] cURL initialized (version: libcurl/7.56.1 WinSSL zlib/1.2.11 WinIDN)
2022.04.21 07:47:13.062 *D* [init.curl          ] cURL supported protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
2022.04.21 07:47:13.062 *D* [netsvc             ] Using cURL version: libcurl/7.56.1 WinSSL zlib/1.2.11 WinIDN
2022.04.21 07:47:13.062 *D* [netsvc             ] Supported protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
2022.04.21 07:47:13.062 *I* [subagents          ] Subagent "NETSVC" (netsvc.nsm) loaded successfully (version 4.0.2157)



lweidig

Threw the agent into debug 9 and see the following which does not help:

2022.04.21 14:13:54.851 *D* [comm.cs.17         ] Requesting metric "Service.Check(pop3://username:[email protected]/,^.*OK Authenticated.*)"
2022.04.21 14:13:54.851 *D* [netsvc             ] H_CheckService(pop3://username:[email protected]/): pattern=^.*OK Authenticated.*
2022.04.21 14:13:54.977 *D* [netsvc             ] H_CheckService(pop3://username:[email protected]/): got reply: 2 bytes
2022.04.21 14:13:54.977 *D* [netsvc             ] H_CheckService(pop3://username:[email protected]/): not matched
2022.04.21 14:13:54.977 *D* [comm.cs.17         ] GetParameterValue("Service.Check(pop3://username:[email protected]/,^.*OK Authenticated.*)"): 0 (SUCCESS) value = "3"


If only I knew what the 2 bytes were...

lweidig

Dumped it and found out the response is CRLF (0a 0d).  Sure enough monitored for that and works.