Send report with SQL query output

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
Guido39
Posts: 65
Joined: Tue Sep 17, 2002 6:00 pm

Post by Guido39 »

I have an ODBC test that checks a count of records and if higher than 1 in the last 10 minutes, it alerts.

But if there are 5 records in the last 10 minutes, I would like to receive a report of those 5 records by using a SQL query.

Is there anyway, in hostmonitor or externally, to do something like this?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

A report with information about records?
Probably you can use "SQL Query" action to create that report..

Regards
Alex
Guido39
Posts: 65
Joined: Tue Sep 17, 2002 6:00 pm

Post by Guido39 »

Actually a report with the SQL query information. For example, I have a query that checks for failed logins from a system. If there is a failed login in the past 10 minutes, it alerts me and I would have to go query the database manually (or use an ASP page) to find out who it was.

What I'm hoping to do is when it alerts, send that information, which I can get using a SQL query, in an e-mail. Something like an e-mail with a SQL query creating the body.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Yes, I understand. You can use "SQL Query" action to execute stored procedure that will create report and another "send e-mail" action to send report as attachment.

Regards
Alex
Guido39
Posts: 65
Joined: Tue Sep 17, 2002 6:00 pm

Post by Guido39 »

That worked. In case anyone is interested, I ran a stored procedure that inserts a query's data to a temp table, writes that temp table's data, along with html code, to another table. I then use the SQL BCP utility to export that table to a HTML file.

The next alert action is to send that HTML file using SMTP. Kind of complex but attached is a nicely formatted HTML file with my query output.

<font size=-1>[ This Message was edited by: Guido39 on 2003-07-18 11:59 ]</font>
Post Reply