[hobbit] addon: os and critical icon
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
On 8/9/07, Flyzone Micky <flyzone at technologist.com> wrote:
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....
I can vouch for the usefulness of an OS icon in the display.
For many sites, there are Windows and Unix admins. This helps them know immediately to "call for help" or to try and login themselves.
Saw an issue that only affected RedHat Linux servers, but I did not realize for a couple of weeks. Once the OS icon feature went in, the scope of the issue to RedHat was obvious.
I am thinking the OS might be known from the client, rather than having to define it on the server. But a manual configuration would be nice, for devices that might be monitored, but without clients.
Scott Walters -PacketPusher
participants (2)
-
flyzone@technologist.com
-
scott@PacketPushers.com