Nagios 4.1.1: Disable hostgroup alphabetic sorting ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Nagios 4.1.1: Disable hostgroup alphabetic sorting ?

Post by nagmoto »

I like to have rendered html page go by following sequence exactly.

Code: Select all

hostgroups             siteA,linux,non-prod,business
But I found "business" will showup in the web page as first one.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios 4.1.1: Disable hostgroup alphabetic sorting ?

Post by rkennedy »

This really isn't going to be possible, unless you modified the C that actually does the sorting. One work around, is to put a number before your hostgroup names. For example -

Code: Select all

hostgroups             siteA,linux,non-prod,business
would become -

Code: Select all

hostgroups             1siteA,2linux,3non-prod,4business
This would then be displayed like so -

Code: Select all

1siteA
2linux
3non-prod
4business
Former Nagios Employee
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: Nagios 4.1.1: Disable hostgroup alphabetic sorting ?

Post by nagmoto »

Can you advise which C file and where I need might need to change ?

Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios 4.1.1: Disable hostgroup alphabetic sorting ?

Post by mcapra »

It would most likely be in cgi/status.c. Without knowing the specific page you're referring to, I can't say for sure.
Former Nagios employee
https://www.mcapra.com/
Locked