Page 1 of 1

Remote server monitoring ports

Posted: Wed Feb 22, 2012 12:28 pm
by kiddbios
Hello,

We have setup Nagios XI and are liking it very much. It has enabled us to monitor through firewalls by NATing ports to NSClient++. One issue we have is with monitoring multiple hosts behind the same firewall. We have it working, but in order to make it operational we have to duplicate a lot of work. Currently we have it setup so that there are services for each port that is being used to communicate. We have modified the check_nt command on these services to have an argument where we can specify the port that is being used.

For example, let's say that I have 2 servers behind the same firewall using the same public IP. By default we use 12489 for the 1st server monitored. For the 2nd we use 11609. So we have services setup such as:

12489 - CPU Usage
12489 - Drive C: Usage
etc.
etc.

11609 - CPU Usage
11609 - Drive C: Usage
etc.
etc.

We then assign the hosts to the services that match the port they're listening on. For each subsequent server we have to add another port and their associated services. As some of our customers have 10+ computers, this becomes a lot of duplication and management.

I was wondering if there was a way to specify the listening port on the host and then point the argument of the services to that value, rather than specifying the port value on each service. That way we would only have 1 service for each item such as CPU Usage, Drive usage, etc.

As always, thank you very much for any input.

Thanks,

Brad

Re: Remote server monitoring ports

Posted: Wed Feb 22, 2012 2:25 pm
by scottwilkerson
I am going to give you the short solution with one caveat, if you upgrade to a newer version you may need to do step 2 again as it will get over-written.

That being said, here is a solution:
1) Every host that is using check_xi_service_nsclient as their check command (should be all that were created with the wizard) will need a free variable setup in the Configure -> Core Config Manager -> Hosts -> Modify -> Misc Settings Tab
portsetup.PNG
2) Once this is done you will change the check_xi_service_nsclient command in Configure -> Core Config Manager -> Commands
check_xi_service_nsclient commands.PNG
Now when you run the wizard in the future you will need to just add the _PORT variable to the host and they should come alive.

Re: Remote server monitoring ports

Posted: Wed Feb 22, 2012 5:02 pm
by kiddbios
That worked like a charm. Thank you very much for your help.

Re: Remote server monitoring ports

Posted: Wed Feb 22, 2012 5:21 pm
by scottwilkerson
I am going to try to setup some time to change the wizards to be able to incorporate this but it may be a while.

Just remember if you upgrade to a newer version you will need to do step 2 again as it will get over-written.