NetXMS Support Forum

English Support => General Support => Topic started by: DanG on September 25, 2013, 10:39:13 AM

Title: ServiceCheck.HTTP - extra info when status 3
Post by: DanG on September 25, 2013, 10:39:13 AM
Hi,

I've been using ServiceCheck.HTTP for a while now. I always compare the returned data with some regex to validate the response.
In the last few days I'm facing intermittent failures for a page, the error code returned is 3 meaning the content doesn't match.
Is there any way to get (save) the returned html so I can examine it? This would be very helpful to investigate the problem further.

Kind regards,
Dan
Title: Re: ServiceCheck.HTTP - extra info when status 3
Post by: Victor Kirhenshtein on September 29, 2013, 01:54:54 PM
Hi!

There are no built-in tool to do this. However, you can configure external script to be executed when you got error 3, and use wget or similar tool to store page content into a file.

Best regards,
Victor
Title: Re: ServiceCheck.HTTP - extra info when status 3
Post by: DanG on September 30, 2013, 01:00:03 PM
Hi Victor,

Unfortunately this would not work very well as the problem is intermittent; as there's a separate call to wget it's more likely to not fetch the erroneous page.

I guess this is a feature request then.

Kind regards,
Dan
Title: Re: ServiceCheck.HTTP - extra info when status 3
Post by: Alex Kirhenshtein on September 30, 2013, 02:18:55 PM
Will be included in 1.2.10, you can also apply attached patch and rebuild portcheck subagent.
To enable this feature, set parameter "FailedDirectory" to any existing directory, whole http response including headers will be dumped there. Name format for dump files is "hostname-unixtimestamp", or "ip-unixtimestamp".

Sample config:
MasterServers = 127.0.0.1
LogFile = /opt/netxms/var/log/nxagentd
*portcheck
FailedDirectory=/tmp/failed
Title: Re: ServiceCheck.HTTP - extra info when status 3
Post by: DanG on September 30, 2013, 03:49:46 PM
Hi Alex,

This must be the fastest reply to a feature request  ;D
Many thanks!
I'll have to wait for net version as I don't have build tools at present.

Kind regards,
Dan