On Fri, 2012-04-20 at 22:51 +0200, Henrik Størner wrote:
Hi John,
I would like to use the 'xymond_filestore' command to append to files when receiving information from a 'data' channel.
[snip description of how it works]
Going back to your original request: Having the data from "data" messages appended to a file. Like the other Xymon channels, information sent via the "data" channel is easily available to any server-side module you can think of. Just run a task out of tasks.cfg that picks up the data-channel messages:
xymond_channel --channel=data mymodule.pland then write your "mymodule.pl" program to do what you like.
Given that what I want to do is store the data, and xymond_filestore stores data, I used that as a starting point rather than re-inventing the wheel :-)
It doesn't have to be Perl; feel free to use whatever scripting tool you fancy. I just used Perl as an example, because there is a little Perl program included with Xymon that shows how to do that - look at the xymond/xymond_rootlogin.pl program.
Yes, I noticed the 'xymond_rootlogin.pl' program. Thanks, it was helpful.
The header-line of a "data" message is different from the "client" header that rootlogin.pl handles, but not very much so you should be able to work it out. You can see the messages by running
xymoncmd xymond_channel --channel=data cat
Interesting. I used the '--debug' options of xymond_channel and xymond_filestore to dump out to the log files what they were doing. It did show what was being sent/received, so again it was helpful in seeing what was going on.
And feel free to use xymond_filestore as a starting point for writing your own data-handling program :-)
I suspect that will be the way I go, probably coupled with the 'usermsg' channel so as to avoid problems with other programs using the other channels.
Many thanks for the explanations.
John.
-- John Horne, Plymouth University, UK Tel: +44 (0)1752 587287 Fax: +44 (0)1752 587001