HttpPage var content as attachment to email alert

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Mellertm
Posts: 10
Joined: Wed Jan 12, 2011 3:49 am

HttpPage var content as attachment to email alert

Post by Mellertm »

To aid our developers in tracking down error responses, i would like to provide the actual output hostmonitor receives when getting certain error codes (500/503 for example).

The most common response from a developer when i tell them a site has an error is: "what was the output?"

I can include the var %HttpPage% in the email body, but this will result in a rather large email notification. I would rather attach it as a txt or htm file.

Can this be done? Or can i write a HM script that saves the %HttpPage% content to a file (and include this file as attachment)?

In an ideal situation hostmonitor would attach a screenshot, but this is not possible at this time.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There is no such option.
May be you can use %HTTPHeader% variable instead?

Another possible workaround: use optional status processing to display first 4096 characters of %HTTPPage% in Reply field of the test item and use %Reply% variable in e-mail template instead of %HTTPPage%
Will it work?

Regards
Alex
Mellertm
Posts: 10
Joined: Wed Jan 12, 2011 3:49 am

RE: HttpPage var content as attachment to email alert

Post by Mellertm »

The header does not provide sufficient information.

Thanks for helping me along, i will explore the possible workarounds.

Although i have to say, i would be a neat feature to let hostmonitor mail screenshots with URL requests in case of an response code other the 200 and 302 for example.

I dont know if this is doable, should i post a feature request?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Although i have to say, i would be a neat feature to let hostmonitor mail screenshots with URL requests in case of an response code other the 200 and 302 for example.
When web server respond with some error code, %HTTPHeader% and %HTTPPage% macro variables provide full information about this problem.
Screen shot?? Screen displays user session, desktop... what it has to do with web server?

Regards
Alex
Mellertm
Posts: 10
Joined: Wed Jan 12, 2011 3:49 am

Post by Mellertm »

My bad, i meant a screenshot of the website requested (output from the webserver).

But you are totally right, %HTTPHeader% and %HTTPPage% macro variables provide all the information.

Thanks again!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

My bad, i meant a screenshot of the website requested (output from the webserver)
Well, web servers do not send images of the pages, they send text, this text is displayed by various web browsers. Different web browsers may display the same page a little bit different. So in order to tae such screen shot, HostMonitor should start web browser and then make screen shot of your desktop?
I think it has no sense at all because
- such image will provide less information that original text HTTP answer from the server
- size of the image (in bytes) will be much larger then size of the HTTP answer from the server
- it will be hard to analyze image by 3rd party programs/scripts, record image in the log and so on

Regards
Alex
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Post by xcentric »

Ok, I have to say something here.

Forget about screenshots.

What about taking the html output from the HtmlPage var and creating an html file on the fly then attach it to an email. A text file with a .htm or .html extension. This might not be allowed as an attachment on most email systems though. But maybe it could be zipped.

Other Uses.

1. Send a trace route output to a text file and attach.
2. Send a ping respose output to a text file and attach.
3. Send hm reports to PDF and attach. Wow, this would be a big improvement. Current reports are text only without graphs in emails. PDF could include graphs. Nice.

1 and 2 I have been trying to do using the for command and an external email vbs script but I havent been able to get it to work right.

Sometimes this informationm is requested as proof of disruption of a critical service and a simple UP or DOWN status is not enough for CTO's or CIO's.

Regards
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Post by xcentric »

Regarding the Trace test. I just realized that you can use TraceFull and TraceBrief macro to get the output.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

No sure I understand the reason of such option.
You may easily use %HttpPage% variable in template for your e-mail. Its not attachment but result is the same.

Regarding PDF and HostMonitor reports: what is has to do with this variable? If you have some utility that converts HTML into PDF, you may use it to convert HostMonitor reports.

Regards
Alex
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Post by xcentric »

I stand corrected. Man I am way off my game today. I should quit for today. :o
Post Reply