[hobbit] addon: os and critical icon

Flyzone Micky flyzone at technologist.com
Thu Aug 9 18:08:04 CEST 2007


Hi, i have made some edit on the hobbit-sources.
When working in a enterprise, i found useful to see also two icons next the hostname: os and critical.
Os could be windows,linux,aix,etc....and critical usually is gold|silver|bronze.
I used the DESCR options in bb-hosts (DESCR:os:critical), hobbit will search for icons with the same 
name adding ".gif" in ~hobbit/server/www/.
If someone needs the gifs just email me.
Maybe will be nice to add it as a new feature in hobbit5.0.

For who wants the same here what to do:
at line 382 of pagegen.c (~hobbit-4.2.0/bbdisplay) BEFORE:
fprintf(output, "%s",
         hostnamehtml(h->hostname, ((pagetype != PAGE_BB) ? hostpage_link(h) : NULL)) );
put these lines:
----------
int count=0;
int i=0;
int j=0;
if (pagepath) {
    for (i=0; i<strlen(pagepath); i++){
        if (pagepath[i]=='/') { count++; }
    }
    if (count!=0){
        count=count/2;
        for (j=0; j<count; j++){
            strcat(urlimg,"../");
        }
    }
}
if (h->description) {
    char * os_name="";
    char * critical="";
    char testo2[40]="";
    char testo3[40]="";
    strcat(testo3,h->description);
    strcat(testo2,h->description);

    critical=strchr(testo2,':');
    if (critical){
      *critical=0;
      critical++;
    }
    os_name=strchr(testo3,':');
    if (os_name){
        *os_name=0;
    }
    os_name=testo3; 

    if (os_name) {
        fprintf(output, "%s%s.gif\" HEIGHT=\"26\" WIDTH=\"26\" ALIGN=\"middle\">    ",urlimg,os_name);
    }
    if (critical) {
        fprintf(output, "%s%s.gif\" HEIGHT=\"26\" WIDTH=\"26\" ALIGN=\"middle\">    ",urlimg,critical);
    }
}
--------

-- 
We've Got Your Name at http://www.mail.com !
Get a FREE E-mail Account Today - Choose From 100+ Domains




More information about the Xymon mailing list