Sorting of the Status's

Andreas Ericsson ae at op5.se
Tue Feb 14 17:05:42 CET 2006


Joseph Hardeman wrote:
> Andreas,
> 
> I have attached my diff.

I noticed. Two things though:
* When using the 'diff' program, you must name the oldest file (or 
directory) first (as I typed it). You did the reverse. Please don't do 
that again.

* When sending a patch out, it's considered common courtesy to keep it 
as uncluttered as possible so you don't waste the time of those you're 
asking for help by shipping a ton of junk. You can do that by reviewing 
the patch-file in an editor before sending it out. If you had done that 
this time you would have noticed that you need to run ./configure either 
in both directories or in none. As it is now I'm not sure what you've 
done in cgi/cgiutils.h (besides adding the SORT_ALIAS macro), and I have 
no interest to reverse your patch and apply it to the same version of 
the source that you created it from, meaning you've gotten less exact 
help than I would otherwise have been willing to give.


>  I modified the status.c and the cgiutils.h files,
> I am fairly sure I am missing something simple.


Yes you are. I'm afraid writing C-code isn't as simple as adding a 
macro, however it's named. You also need to change the algorithm to 
match on alias rather than hostname. This you can do by passing the 
alias pointers from the host data structs to the strcmp() calls just 
below where you replaced SORT_HOSTNAME with SORT_ALIAS.


>  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.
> 

Renaming variables, constants and macros isn't programming, whatever 
language you choose.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642




More information about the Developers mailing list