Page 1 of 1

Re: [Nagios-devel] Sorting of the Status's

Posted: Tue Feb 14, 2006 5:26 am
by Guest
Joseph Hardeman wrote:
> 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(" HREF='%s?type=%d&host=%s'>%s\n",host_status_bg_class,EXTINFO_CGI,DISPLAY_HOST_INFO,url_encode(temp_status->host_name),temp_host->alias);
>
>
> LINE 1999
> printf(" HREF='%s?type=%d&host=%s'>%s \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?

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]