Xymon Cron Question
list John Kramer
Hi, Very new to Xymon here, so I apologize if this is a newb question. We have a test script that runs as cron and inspects the state of the system (returns 0 for success, returns non 0 for failure). We would like to report the result of that test through Xymon. Any help as to how to do this would be appreciated. Thanks! John Kramer Product Manager - Enterprise Security Solutions <mailto:user-4c85ce9779d7@xymon.invalid> user-4c85ce9779d7@xymon.invalid Mobile: XXX.XXX.XXXX Skype: john.kramer_comodo <http://www.comodo.com/> http://www.comodo.com Description: Description: https://www.thesslstore.com/images/partner-comodo-logo.jpg
Attachments (1)
list Japheth Cleaver
▸
On Mon, August 19, 2013 9:10 pm, John Kramer wrote:
Hi, Very new to Xymon here, so I apologize if this is a newb question. We have a test script that runs as cron and inspects the state of the system (returns 0 for success, returns non 0 for failure). We would like to report the result of that test through Xymon. Any help as to how to do this would be appreciated.
Hello, The basic principle is to create a script like seen at: http://www.xymon.com/xymon/help/xymon-tips.html#scripts However, since you're running this via cron and outside of the xymonlaunch environment, you'll want to prepend your command with xymoncmd to allow the default environment variables to "just work": 5 * * * * /path/to/xymoncmd --env=/etc/xymon-client/xymonclient.cfg /path/to/yourscript/here (Note that depending on your install "xymonclient.cfg" might be in a different location as well.) HTH, -jc
list Phil Crooker
You can start with the help files, specifically: http://www.xymon.com/xymon/help/xymon-tips.html#scripts This shows about custom scripts. For me, the easiest way is to install a xymon client on the system you want to run this test on, then setup that client to do the test, see the clientlaunch.cfg file in the xymon client home etc directory. You add your test there, as in: [dguard] ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg CMD /bin/sh $XYMONCLIENTHOME/ext/dguard.sh INTERVAL 5m So that script needs to run as the xymon user, so you need to test using that account. Then, add whatever you call that test to the monitored host in the hosts.cfg (ie 10.1.2.35 hostname.domain # ftp smtp dns mytest ). The other way of doing it is to run everything from the xymon server, in this case you'd ssh (or however) to the host and run the command and return the results. It just depends on how you want to set up your xymon environment. You may in fact be able to get whatever you are testing for from the xymon client - it does have a lot of state information to choose from. Hope this helps, Phil Crooker
▸
From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of John Kramer
Sent: Tuesday, August 20, 2013 6:40 AM
To: xymon at xymon.com
Subject: [Xymon] Xymon Cron Question
Hi,
Very new to Xymon here, so I apologize if this is a newb question.
We have a test script that runs as cron and inspects the state of the system (returns 0 for success, returns non 0 for failure). We would like to report the result of that test through Xymon.
Any help as to how to do this would be appreciated.
Thanks!
John Kramer
Product Manager - Enterprise Security Solutionsuser-4c85ce9779d7@xymon.invalid<mailto:user-4c85ce9779d7@xymon.invalid> Mobile: XXX.XXX.XXXX Skype: john.kramer_comodo http://www.comodo.com<http://www.comodo.com/>; [Description: Description: https://www.thesslstore.com/images/partner-comodo-logo.jpg]
attachment.jpg