<div dir="ltr">Thx Adam,<div><br></div><div>that was fast.</div><div>Your perl snippet looks interesting, but, as you said, it is maybe a bit oversophisticated for my needs.</div><div>But anyway, you pointed me to a suitable idea: not to collect all data and add to a (then lengthy and hard to manage) analysis.cfg, but to create single files, have a analysis_master.cfg, and combine all of these regularly (nightly cronjob) into a working analysis.cfg. If I have to edit the master cfg this must be done manually.</div><div><br></div><div>I wonder why there is the host.d and tasks.d functionality implemented (never needed or used this), but no analysis.d or alerts.d, as those files can become very large and complex.</div><div>Maybe a small feature request for the next version?</div><div><br></div><div>regards </div><div>Norbert</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Fr., 3. Juni 2022 um 11:19 Uhr schrieb Adam Thorn <<a href="mailto:alt36@cam.ac.uk">alt36@cam.ac.uk</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 03/06/2022 09:49, nor krie wrote:<br>
<br>
> I thought I can just create these cfg files in $XYMONHOME/etc/analysis.d <br>
> and it will be used similar to hosts.d or tasks.d directories.<br>
> But obviously this does not work (and also there is no mention of <br>
> analysis.d in the manuals).<br>
> <br>
> Of course I can add all these lines directly into analysis.cfg, but this <br>
> would create a very huge file.<br>
<br>
analysis.cfg is read by xymond_client. Having looked quickly at the <br>
xymond_client.c source, it is definitely written to only load config <br>
from a single config file, which defaults to $XYMONHOME/etc/analysis.cfg<br>
<br>
I've a somewhat experimental small gitlab project that I've never really <br>
used for anything in production:<br>
<br>
<a href="https://github.com/alt36/cgifs" rel="noreferrer" target="_blank">https://github.com/alt36/cgifs</a><br>
<br>
which lets you use Fuse to "mount" an arbitrary script at a directory of <br>
your choice. So, if you used it to..<br>
<br>
./<a href="http://cgifs.pl" rel="noreferrer" target="_blank">cgifs.pl</a> /etc/xymon/foo/ /path/to/script.sh<br>
<br>
and then adjusted your tasks.cfg entry for xymond_client to use <br>
--config=/etc/xymon/foo/analysis.cfg rather than the default, then <br>
reading the specified config file would return the output of<br>
<br>
/path/to/script.sh analysis.cfg<br>
<br>
script.sh could then just be something like<br>
<br>
#!/bin/bash<br>
cat /etc/xymon/analysis.d/*.cfg<br>
<br>
Of course, you'd achieve a very similar effect (and probably a lot more <br>
robustly than my slightly hacky perl!) by having a cron job generate <br>
your analysis.cfg from fragments you've put in an analysis.d directory. <br>
Although, with my <a href="http://cgifs.pl" rel="noreferrer" target="_blank">cgifs.pl</a> version you could have script.sh instead run <br>
the bash loop you posted (but echoing to stdout rather than writing to <br>
servername.cfg) and always have the "live" version available...<br>
<br>
Adam<br>
<br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</blockquote></div>