Ok i think i just found the way myself by grepping everything everywhere ...
in criticalview.sh, it is possible to override the critical conf file with "--config":
[root at xymon cgi-bin]# grep -n -- --config /opt/repo/src/xymon-4.3.7/web/criticalview.c 481: else if (argnmatch(argv[argi], "--config=")) {
So, by modifying criticalview_NEW.sh exec /opt/xymon//server/bin/criticalview.cgi $CGI_CRITVIEW_OPTS --config=/opt/xymon/server/etc/critical_top30.cfg
now, the /cgi-bin/criticalview_NEW.sh shows the devices of critical_top30.cfg ONLY :)
thanks and sorry for the noise.
Cheers nico
Le 24 juil. 2012 à 20:54, Nico a écrit :
Hi
I d like to understand how the /xymon-cgi/criticalview.sh|criticalview.cgi works.
In fact; this view is really useful; and i would like to create new critical view like this one with different hosts. (one critical view for top10 customers for instance; another one for Spain hosts only etc).
I tried to duplicate criticalview.sh to criticalview_NEW.sh and to modify the ENV variable:
. /opt/xymon//server/etc/cgioptions_NEW.cfg
and in this file to change XYMONENV=/opt/xymon//server/etc/xymonserver_NEW.cfg instead of /xymonserver.cfg then in this file i modified HOSTSCFG="$XYMONHOME/etc/hosts.d/top10customers.cfg" instead of HOSTSCFG="$XYMONHOME/etc/hosts.cfg. but it doesn t change anything; criticalview_NEW.sh is still showing everything :/
I also though about having multiple critical.cfg but i don t know how to tell xymon to look at another critical.cfg file :(
in /web/criticalview.c, there is a reference to this file:
if (!critconfig[0]) { critconfig = (char **)realloc(critconfig, 2*sizeof(char *)); critconfig[0] = (char *)malloc(strlen(xgetenv("XYMONHOME")) + strlen(DEFAULT_CRITCONFIGFN) + 2); sprintf(critconfig[0], "%s/%s", xgetenv("XYMONHOME"), DEFAULT_CRITCONFIGFN); critconfig[1] = NULL; }
and DEFAULT_CRITCONFIGFN is defined in /opt/repo/src/xymon-4.3.7/lib/loadcriticalconf.h
#define DEFAULT_CRITCONFIGFN "etc/critical.cfg"
but don t see anywhere how to override this variable ?
tried also to create a new view with xymongen but it generates only a basic critical.html and nongreen.html file... nothing related to the CGI at the end :(
any clue will be appreciated.
thanks
Cheers Nico