NetXMS Support Forum

English Support => General Support => Topic started by: Nikk on December 09, 2013, 04:38:35 PM

Title: ServiceCheck.HTTP
Post by: Nikk on December 09, 2013, 04:38:35 PM
Hi,

I read through the entire forum, but did not find anything to my problem, so I came here.
I tried to configure ServiceCheck.HTTP, but all the time I'm getting status 3 - bad server's response.
Here is my check:
ServiceCheck.HTTP(192.168.0.150,80,/index.html,www.domain.lv,"^HTTP/1\.[01] 200 .*")
Actually I can't successfully check any web, maybe I don't realy know how.
Subagent is loaded successfully and other service checks are working.
Where is my configuration mistake?

Thanks in advance,
Nikk
Title: Re: ServiceCheck.HTTP
Post by: Alex Kirhenshtein on December 12, 2013, 02:22:50 PM
I suggest you to switch to new "netsvc" subagent. Right now it's quite basic, but usually works better than old portcheck.

netsvc provide single DCI: Service.Check(URL, regexp)

If second parameter is omitted, default "^HTTP/1.[01] 200 .*" will be used.

Some samples:

Service.Check(https://netxms.org/)
Service.Check(https://netxms.org/, text)
Service.Check(http://user:[email protected]/)
Service.Check(ftp://user:[email protected]/file, text)
Service.Check(sftp://user:[email protected]/another.file, text)

Check http://curl.haxx.se/docs/manpage.html#URL for details
Some protocol can be disabled in your particular build, to list them start agent with debug level 3 or higher and look for following lines:
[12-Dec-2013 14:17:18.578] [DEBUG] cURL version: libcurl/7.30.0 SecureTransport zlib/1.2.5
[12-Dec-2013 14:17:18.578] [DEBUG] Supported protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
[12-Dec-2013 14:17:18.578] [INFO ] Subagent "netsvc.nsm" loaded successfully
Title: Re: ServiceCheck.HTTP
Post by: Nikk on December 12, 2013, 02:48:40 PM
Looks nice!
How do I enable this subagent? I tried SubAgent = netsvc.nsm on windows machine, but received: Error loading subagent module "netsvc.nsm": The specified module could not be found.
Should I rebuild server to acquire this module?

Nikk
Title: Re: ServiceCheck.HTTP
Post by: raypetter on January 18, 2014, 12:08:11 PM
I'm also interested in using netsvc, but I can't find it. I've used the deb packages.
Title: Re: ServiceCheck.HTTP
Post by: Victor Kirhenshtein on January 20, 2014, 10:45:51 AM
Hi!

Seems that both Windows and Debian packages was built with netsvc subagent omitted. I'll build both versions a bit later and post a download link.

Best regards,
Victor
Title: Re: ServiceCheck.HTTP
Post by: Dani@M3T on January 20, 2014, 10:53:59 AM
Should netsvc be an external modul like the other subagents? We compiled on linux from sources, but there is no such subagent too
Title: Re: ServiceCheck.HTTP
Post by: Victor Kirhenshtein on January 20, 2014, 11:08:17 AM
netsvc subagent need libcurl, and so it will only built if libcurl development package is installed. Try to install libcurl-devel package and run configure and make again.

Best regards,
Victor
Title: Re: ServiceCheck.HTTP
Post by: Dani@M3T on January 20, 2014, 12:29:08 PM
Hi

I didn't know that (is it somewhere documented?) but compiled with libcurl-devel and activation of netsvc subagent in agent config I can see the new DCI. Now I have to explore the functionality of this subagent. thanks

Dani
Title: Re: ServiceCheck.HTTP
Post by: raypetter on January 20, 2014, 10:57:03 PM
No rush on my part. I'll wait until you have the pacakges ready Victor. Thanks.