ServiceCheck.HTTP - extra info when status 3

Started by DanG, September 25, 2013, 10:39:13 AM

Previous topic - Next topic

DanG

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

Victor Kirhenshtein

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

DanG

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

Alex Kirhenshtein

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

DanG

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