Question about Configuration Wizards - Populating a list

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Question about Configuration Wizards - Populating a list

Post by Box293 »

Is it possible during the configuration wizard to produce a drop down list of all existing hosts? If so can you please explain with a code example.

For instance, this would be handy when someone is running the configuration wizard to add more services to a host. Being able to select from a list of existing hosts would save the user from having to type something in.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
TSCAdmin
Posts: 155
Joined: Wed Apr 14, 2010 3:00 pm
Location: India

Re: Question about Configuration Wizards - Populating a list

Post by TSCAdmin »

Take a look at the snmp-trap wizard on the Exchange ... it pulls the hosts back as a checkbox list. No reason you couldn't use a scroll list instead.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Question about Configuration Wizards - Populating a list

Post by mmestnik »

We were discussing this and the potential scalability to say 32k hosts. A pull down just doesn't sound like the correct solution.

Any input would be appreciated, as I'm in the middle of fixing up the SNMP Trap Wizard now.
TSCAdmin
Posts: 155
Joined: Wed Apr 14, 2010 3:00 pm
Location: India

Re: Question about Configuration Wizards - Populating a list

Post by TSCAdmin »

What would be nice is the ability to apply the configuration to the hosts within a host-group, instead of a list of individual hosts.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Question about Configuration Wizards - Populating a list

Post by mmestnik »

For that... all you'd need is to use the hostgroup. If there is anywhere that one can't use a hostgroups instead of hostnames, let us know.

Here is some not so fancy JS/PHP that should be usable else where.
http://go.nagios.com/forum/310/1488
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Question about Configuration Wizards - Populating a list

Post by Box293 »

Thanks for all the answers, sounds like the hard work has been done for me :lol:

32k hosts poses quite a conundrum.

Alpha-numeric grouping is flawed when 70% of your hosts all start with the same letter.

Does Nagios XI kept a record (like a count) of how many active hosts there are?

If so you could divide that number into equal bunches of 2,3,4 ... to whatever the max size a bunch is definied as. That would then determine how many bunches are created. I'm using the word bunch as (group) would lead to much confusion.

As to how those bunches are displayed on the screen would be important as well.

Lets say there are enough hosts to display 6 bunches at 2000 hosts each.

Perhaps at the first screen you could have a radio option of selecting a new host or existing host(s).
If you selected existing hosts then it would then redisplay this first screen with 6 bunches displayed, three across by two down or two across by three down. The user could then shift click to select multiple hosts in each bunch. This would allow them the ability to select hosts from different bunches. Additionally a check box for each bunch if you just wanted all hosts in this bunch to be selected.

Or another idea is at the first screen you have a radio option of selecting a new host or existing host(s).
Underneath you can display the box for the IP address as per normal.
Under that you could have 3 bunches across, only 1 row.
There is a left arrow button and a right arrow button at each end of the bunches.
When you click the right button the bunches all move towards the left and a new bunch appears on the right (losing the bunch that was on the left).
So you could cycle the bunches along either left or right. Specifically there would be no end, you would just have an circle so to speak.

If you are at the begining [like "A host called A"] and pressed the left button the boxes all move towards the rigth and a new box appears on the left showing the "end" of the bunches [like "Z host called Z"] (losing the box that was on the right).

So this will only cycle 1 bunch with each click of the left or right buttons.

You could additionaly have an up and down button at the top and bottom of the row of bunches.
When you clicked the down button, all three bunches would display what the next three bunches are in sequence
Say:
1-2000 2001-4000 4001-6000
this would become
6001-8000 8001-10000 10001-12000

So effectively you get three new bunches with each click instead of having to click three times.

The up button would cycle in the opposite direction.

I am not sure with this idea if the user would be able to select items and then cycle to more bunches and still have those items selected.

Then the next stages of the wizard would follow like normal.

Not sure if any of this is possible.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
TSCAdmin
Posts: 155
Joined: Wed Apr 14, 2010 3:00 pm
Location: India

Re: Question about Configuration Wizards - Populating a list

Post by TSCAdmin »

Regular expressions would work well, if the hosts used a logical naming convention and you wanted to apply the configuration change to a swath of servers.

As an example: ^(us|uk)-(dal|lon|bos)-sv[ske]-[0000-9999] would catch servers of various types, but not switches, routers, and other infrastructure equipment.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Question about Configuration Wizards - Populating a list

Post by Box293 »

TSCAdmin wrote:What would be nice is the ability to apply the configuration to the hosts within a host-group, instead of a list of individual hosts.
I want to discuss this further, I have created a seperate topic:

http://go.nagios.com/forum/301
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Question about Configuration Wizards - Populating a list

Post by mmestnik »

Box293 wrote:Thanks for all the answers, sounds like the hard work has been done for me :lol:

32k hosts poses quite a conundrum.

Alpha-numeric grouping is flawed when 70% of your hosts all start with the same letter.
This is possible, though vary long prefixes will make output ugly. You would do a controlled break on prefix, with *prefix length and record count being your controls. I have some code lying around the clips(Replaces an arbitrary section with "...") the middle of a path so that the prompt is still readable but fit's in a 57 char limit, useful on 80x24 terminals. So the same could be done for long prefixes, however you'd still be looking at 5 to 13 chars where at most 2 would be normal/expected. The solution to this problem would be...

* After looking at the first 5 or so(You may have to ignore the first few as not being part of this prefix, I.E. part of the last prefix.) you should have a hard prefix length, then when you find a match much smaller then that after X hosts you break. The output should look like "Servers-Minnesota-StC to P" Indicating all the servers in St. Cloud, where the next page starts with all the servers in St. Paul. In this example the prefix would have been Servers-Minnesota-StCloud- as found in Servers-Minnesota-StCloud-Alpha Servers-Minnesota-StCloud-Beta Servers-Minnesota-StCloud-Gamma. The breaking record would have been Servers-Minnesota-StCloud-Alpha, where the previous prefix length was 26 and we would break when this dropped to 20. This range could be clipped into a 3x7: "Ser::ota-StC to P" making it shorter, but still getting the data across.

This brings me to the "real solution" Why have extra long hostnames like this? Why not abbreviate everything this way, instead of using Servers-Minnesota-StCloud-Gamma as a name, why not use the correct name for alpha listings the way ppl treat say movie titles with the prefix "The". Just call your servers by a short and sortable name to begin with: "Gamma.Ser::ota-StC" it's every bit the same as Servers-Minnesota-StCloud-Gamma, but it is both sortable and readable. You can put the other longer name in the alias field.
Box293 Cont wrote:
Does Nagios XI kept a record (like a count) of how many active hosts there are?
This tackles a different problem, that should be left up to user preferences... For this there should be a user control for how many items on a page.
Box293 Cont wrote:
Or another idea is at the first screen you have a radio option of selecting a new host or existing host(s).
Underneath you can display the box for the IP address as per normal.
Under that you could have 3 bunches across, only 1 row.
There is a left arrow button and a right arrow button at each end of the bunches.
When you click the right button the bunches all move towards the left and a new bunch appears on the right (losing the bunch that was on the left).
So you could cycle the bunches along either left or right. Specifically there would be no end, you would just have an circle so to speak.

If you are at the begining [like "A host called A"] and pressed the left button the boxes all move towards the rigth and a new box appears on the left showing the "end" of the bunches [like "Z host called Z"] (losing the box that was on the right).

So this will only cycle 1 bunch with each click of the left or right buttons.

You could additionaly have an up and down button at the top and bottom of the row of bunches.
When you clicked the down button, all three bunches would display what the next three bunches are in sequence
Say:
1-2000 2001-4000 4001-6000
this would become
6001-8000 8001-10000 10001-12000

So effectively you get three new bunches with each click instead of having to click three times.

The up button would cycle in the opposite direction.
This is a great idea, using a basic BTree index this could be implemented easily. A BTree is a lot like what I was describing erlier, though there would be prefixes like Servers-, sub-prefixes like Minesota-, and sub-sub-prefixes like StCloud- and StPaul-.
Box293 Cont wrote:
I am not sure with this idea if the user would be able to select items and then cycle to more bunches and still have those items selected.

Then the next stages of the wizard would follow like normal.

Not sure if any of this is possible.
It's defiantly something to think on.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Question about Configuration Wizards - Populating a list

Post by Box293 »

mmestnik wrote:This brings me to the "real solution" Why have extra long hostnames like this? Why not abbreviate everything this way
Conversations about naming standards always go on and on and on and on :lol:

I agree though, I've been thinking about how to get some names as short as possible while maintaining clear readability.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked