Sorting of the Status's

Joseph Hardeman jwhardeman at gmail.com
Tue Feb 14 16:07:46 CET 2006


Andreas,

I have attached my diff.  I modified the status.c and the cgiutils.h files,
I am fairly sure I am missing something simple.  I am wanting any aliases
that are capitalized to be at the top of the list and the non capitalized
aliases below them.  This will allow the help desk to see the primary
servers and routers at the sites before seeing the access points.  Will make
it easier for them to see if a server or possibly circuit is down if the
router is also down.

I have done very limited c scripting.  Mostly just looking though and
modifying c programs before I compile them if they need to be.  Most of its
been with nagios over the years.  Mostly I work in shell, perl or php.

Thanks for all of your help.

Joseph


>> Greetings,
> >>
> >> I see that there are 8 different ways to sort the status page.  I want
> to be
> >> able to sort by Aliases.
> >>
> >> I have added a 9th way, SORT_ALIAS to the include/cgiutils.h and
> recompiled
> >> the cgis.
> >
> >
> >Exactly how did you do to add this to include/cgiutils.h without
> >modifying the sorting algorithm in status.c as well?
> >
> >Do like this:
> >
> >Download the nagios-2.0.tar.gz file to $HOME/patch
> >Run the following commands
> >
> >$ cd $HOME/patch
> >$ tar xvzf nagios-2.0.tar.gz
> >$ mv nagios-2.0 nagios-2.0.patched
> >$ tar xvzf nagios-2.0.tar.gz
> >$ cd nagios-2.0.patched
> >
> >Make your modifications to whatever files you did, and then do this:
> >
> >$ cd $HOME/patch
> >$ diff -urN nagios-2.0 nagios-2.0.patched > nagios-sort-alias.diff
> >
> >Send nagios-sort-alias.diff to this list and I'll have a look at it for
> you.
> >
> >
> >>  I then modified the status.c to display the following lines:
> >>
> >> LINE 1554
> >>  printf("<TD align=left valign=center CLASS='status%s'><A
> >>
> HREF='%s?type=%d&host=%s'>%s</A></TD>\n",host_status_bg_class,EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),temp_host->alias);
> >>
> >>
> >> LINE 1999
> >> printf("<TD align=left valign=center CLASS='status%s'><A
> >>
> HREF='%s?type=%d&host=%s'>%s</A> </TD>\n",status_class,EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),temp_host->alias);
> >>
> >> (((Changed from temp_status->host_name to temp_host->alias)))
> >>
> >> This displays the Alias but it is still being sorted by
> host_name.  When I
> >> checked all SORT_HOSTNAME to SORT_ALIAS I do not get an error, but it
> is
> >> still only sorting by hostname.  What am I missing to get it to sort by
> host
> >> name.
> >
> >
> >Judging from your description; something fairly elementary. How much
> >C-code have you written earlier?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060214/36b5250d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-sort-alias.diff
Type: application/octet-stream
Size: 24446 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060214/36b5250d/attachment.obj>


More information about the Developers mailing list