-
Help with module_max? No report when entered
I noticed someone had previously entered a request to be able to view the number of Errors in the Windows Event logs, when I started to code this I got 90% of the way there but I can’t make Pandora generate a alert.
Here is my code:
module_begin
module_name SystemErrorEvents
module_type generic_proc
module_exec logparser.exe -i:EVT -o:NAT “SELECT EventTypeName FROM System WHERE TimeWritten >= SUB( TO_LOCALTIME(SYSTEM_TIMESTAMP()), TIMESTAMP(‘0000-01-02’, ‘yyyy-MM-dd’) )” -rtp:-1 | grep “Error event” | wc -l | tr -d ” ”
#module_max 1
module_description Check for the number of Errors in the Event Log
module_endThis outputs the number 10, for a total of 10 errors in my event log.
If I uncomment the line module max = 1 then this module does not send any data to the server.As is, it shows up on my main page with a total a value of 10, but I need pandora to know that if the number >0 to generate an alert.
I have tried with and without the
part, the result is the same. Anyone have any ideas?
———-
For the ones who are interested, logparser.exe is a tool from microsoft to take event logs from Windows and manipulate them. The code that I have above will show the last days events with the tag “Error event”.
Slight modificiations to the above code would also alow you to track ‘warning’ events as well as enteries the ‘application’ log.
This works on ALL microsoft operating systems to my knowledge, I used it on Server 2003 (various editions) as well as my home PC Vista X64 Enterprise edition.