ServiceCheck.HTTP

Started by Nikk, December 09, 2013, 04:38:35 PM

Previous topic - Next topic

Nikk

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

Alex Kirhenshtein

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

Nikk

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

raypetter

I'm also interested in using netsvc, but I can't find it. I've used the deb packages.

Victor Kirhenshtein

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

Dani@M3T

Should netsvc be an external modul like the other subagents? We compiled on linux from sources, but there is no such subagent too

Victor Kirhenshtein

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

Dani@M3T

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

raypetter

No rush on my part. I'll wait until you have the pacakges ready Victor. Thanks.