Xymon Mailing List Archive search

findhost.sh with a different cfg env

3 messages in this thread

list Mario Andre · Fri, 17 May 2024 12:03:32 -0300 ·
Hello all,

In old xymon/hobbit 4.3.0 version I used to generate different views using
bbcmd and modifieds hobbitserver.cfg and bb-hosts files.
Also for these different views I was able to create independent findhosts
and enable/disable views for these specific env and bb-hosts files.

For example:
$cat bb-findhost-nwgroupview.sh
#!/bin/sh
# This is the Hobbit CGI script interface to bb-findhost.CGI
. /home/xymon/server/etc/hobbitcginwgroupview.cfg
 exec /home/xymon/server/bin/bb-findhost.cgi $CGI_FINDHOST_OPTS


How can we do this kind of modified findhost cgi calls on Xymon version
4.3.30? How can I use and call findhost.sh to use a modified/renamed
cgioptions.cgi ?

Thanks in advance.


Best regards,
Mario
list Jeremy Laidman · Mon, 20 May 2024 10:00:23 +1000 ·
Hi Mario

I imagine that you can still do the same thing. The only difference is that
findhost.sh is now a binary rather than a script, and instead of it calling
findhost.cgi, it implements the findhost.cgi functionality itself.

So, in the same way that findhost.sh was a wrapper around findhost.cgi, you
can write findhost-nwgroupview.sh as a wrapper around the new findhost.sh.
Simply adjust your script to call findhost.sh instead of findhost.cgi.
Although findhost.sh is in the cgi-bin directory now, so something like:

 exec /home/xymon/server/cgi-bin/findhost.sh $CGI_FINDHOST_OPTS

Cheers
Jeremy
quoted from Mario Andre

On Sat, 18 May 2024 at 01:05, Mario <user-82c7780661a4@xymon.invalid> wrote:
Hello all,

In old xymon/hobbit 4.3.0 version I used to generate different views using
bbcmd and modifieds hobbitserver.cfg and bb-hosts files.
Also for these different views I was able to create independent findhosts
and enable/disable views for these specific env and bb-hosts files.

For example:
$cat bb-findhost-nwgroupview.sh
#!/bin/sh
# This is the Hobbit CGI script interface to bb-findhost.CGI
. /home/xymon/server/etc/hobbitcginwgroupview.cfg
 exec /home/xymon/server/bin/bb-findhost.cgi $CGI_FINDHOST_OPTS


How can we do this kind of modified findhost cgi calls on Xymon version
4.3.30? How can I use and call findhost.sh to use a modified/renamed
cgioptions.cgi ?

Thanks in advance.


Best regards,
Mario

list Jeremy Laidman · Fri, 24 May 2024 08:50:40 +1000 ·
Mario

I'm not sure. Can you show your wrapper script?

How are you having findhost use your abridged hosts.cfg file?

Cheers
Jeremy


On Fri, 24 May 2024, 01:16 Mario, <user-82c7780661a4@xymon.invalid> wrote:
Hello Jeremy,

Thanks for your response.
Yes, this works partially now.
I can call the findhostnwgroup.sh however the issue is that the search
result is showing all found occurences from the entire
monitoring/"official" hosts.cfg file and not only from the specific
hostsnwgroup.cfg file.
Even if I force findhost.sh with --env="" option still shows all from my
system and it seems to don?t load the different env configuration.
Do you have an idea on how to get the findhost.sh load the different env
options?


Thanks & regards,
Mario
quoted from Jeremy Laidman


On Sun, May 19, 2024 at 9:01?PM Jeremy Laidman <user-0608abae5e7c@xymon.invalid> wrote:
Hi Mario

I imagine that you can still do the same thing. The only difference is
that findhost.sh is now a binary rather than a script, and instead of it
calling findhost.cgi, it implements the findhost.cgi functionality itself.

So, in the same way that findhost.sh was a wrapper around findhost.cgi,
you can write findhost-nwgroupview.sh as a wrapper around the new
findhost.sh. Simply adjust your script to call findhost.sh instead of
findhost.cgi. Although findhost.sh is in the cgi-bin directory now, so
something like:

 exec /home/xymon/server/cgi-bin/findhost.sh $CGI_FINDHOST_OPTS

Cheers
Jeremy

On Sat, 18 May 2024 at 01:05, Mario <user-82c7780661a4@xymon.invalid> wrote:
Hello all,

In old xymon/hobbit 4.3.0 version I used to generate different views
using bbcmd and modifieds hobbitserver.cfg and bb-hosts files.
Also for these different views I was able to create independent
findhosts and enable/disable views for these specific env and bb-hosts
files.

For example:
$cat bb-findhost-nwgroupview.sh
#!/bin/sh
# This is the Hobbit CGI script interface to bb-findhost.CGI
. /home/xymon/server/etc/hobbitcginwgroupview.cfg
 exec /home/xymon/server/bin/bb-findhost.cgi $CGI_FINDHOST_OPTS


How can we do this kind of modified findhost cgi calls on Xymon version
4.3.30? How can I use and call findhost.sh to use a modified/renamed
cgioptions.cgi ?

Thanks in advance.


Best regards,
Mario