Xymon Mailing List Archive search

generate eventlog report from shell ?

2 messages in this thread

list Bakkies Gatvol · Thu, 9 Aug 2018 13:28:31 +0000 ·
Is there a way to generate an event log report from the shell? I want to email a monthly report of change in status for column X . One of those things where one failure is not alert-worthy, but if the problem keep re-occurring, somebody need to look.


Bakkies
list Jeremy Laidman · Tue, 21 Aug 2018 11:46:31 +1000 ·
Bakkies

If you don't mind a report in HTML, you can use wget or curl to fetch the
required report by copying the URL from a report you've already generated.
Something like this:

curl -s -k '
https://127.0.0.1/xymon-cgi/eventlog.sh?MAXTIME=&FROMTIME=&TOTIME=&MAXCOUNT=100&HOSTMATCH=some-server.example.com&EXHOSTMATCH=&PAGEMATCH=&PATHLIST=&EXPAGEMATCH=&TESTMATCH=&EXTESTMATCH=&COLORMATCH=&Send=View+log
'

You don't actually need to define any parameters, and the defaults should
give you something. The only thing you need to provide is some kind of
variable so that QUERY_STRING exists so this should work:

curl -s -k 'https://127.0.0.1/xymon-cgi/eventlog.sh?-';

You can query Xymon directly without going through the webserver, using the
eventlog.cgi command, with output also in HTML format. It needs a Xymon
environment setup (eg run via xymoncmd) and it also needs REQUEST_METHOD to
be defined (but can be empty), and it will output a report using defaults:

xymoncmd sh -c 'REQUEST_METHOD="" eventlog.cgi'

You can define QUERY_STRING to specify the parameters of the report, but
unless REQUEST_METHOD is set to "GET", it won't be parsed. For example:

 xymoncmd sh -c 'REQUEST_METHOD="GET" QUERY_STRING="HOSTMATCH=
some-server.example.com" eventlog.cgi'

Cheers
Jeremy
quoted from Bakkies Gatvol

On 9 August 2018 at 23:28, Bakkies Gatvol <user-66e2e196cd54@xymon.invalid> wrote:
Is there a way to generate an event log report from the shell? I want to
email a monthly report of change in status for column X . One of those
things where one failure is not alert-worthy, but if the problem keep
re-occurring, somebody need to look.


Bakkies