Page 1 of 2

Monitoring remote servers 2

Posted: Thu Feb 02, 2012 10:42 am
by kiddbios
Hello,

In this thread http://support.nagios.com/forum/viewtop ... f=6&t=4831 (now locked) I was instructed how to change the monitoring port for monitoring remote servers through a firewall. I followed the instructions, but when I got to the part about changing the ARG3 for service checks, I was unsure what to do.
Am I supposed to change this on a per-service basis?
If yes, am I supposed to change ARG3 for the check_nt parameter? It seemed that the ARG3 on the check_nt parameter has other values that specify what is to be monitored. Am I supposed to append it to that check?
Also, if I want to have a service that I add hosts to (like if I want to configure a service to be monitored and then add the hosts that have that service instead of creating a new service entry for each individual host) will I have to create an individual entry for every service on every host and specify which port they're to be monitored on?

Thanks,

Brad

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 10:58 am
by scottwilkerson
The default check_nt command didn't use $ARG3$, we are changing that so you can use $ARG3$ to specify the port you wanted to use. I was assuming you wanted a way to make to change the ports that the check is done on, on a per check basis so you can check multiple machines behind the same firewall.

So to answer your question, yes, you would need to specify this per service.

So if you could monitor
workstation 1 via port 9677
workstation 2 via port 9678
workstation 3 via port 9679
workstation 4 via port 9680

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 11:06 am
by kiddbios
Scott,

Thank you so much for your quick reply. Is there a way to specify this on a per host basis? I would want to monitor all services for a given host on a specified port rather than creating a new service for every service on every host.

Also, where do I change or add ARG3 on a service and for which parameter do I change it? I tried putting in port 11609 (which I've verified the NS++ client is listening on and properly forwarding through the firewall) as $ARG3$ on the ping command. The server is still showing as down.

Thanks,

Brad

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 11:10 am
by kiddbios
I think where the confusion may be coming in is that there are values on the $ARG3$ line for check_nt for most of the services. For instance, the CPU check has the following values under the check_nt command (under common values):

$ARG1$ password
$ARG2$ CPULOAD
$ARG3$ -l 5,80,90

I changed the check_nt command from $ARG3$ to $ARG8$ and then added 11609 (the port I'm listening on) in the $ARG8$ field under the check_nt command on each service that is to be monitored. The host still shows as being down. When I go to the host detail I have an error that says: "The port must be an integer"

Thanks,

Brad

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 11:31 am
by scottwilkerson
kiddbios wrote: I changed the check_nt command from $ARG3$ to $ARG8$ and then added 11609 (the port I'm listening on) in the $ARG8$ field under the check_nt command on each service that is to be monitored. The host still shows as being down. When I go to the host detail I have an error that says: "The port must be an integer"

Thanks,

Brad
This sounds correct, can you attach a screenshot of your service settings screen

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 11:36 am
by kiddbios
The screenshot is attached. Thank you so much for the help. Please let me know if there is any other information I can provide.

Thanks,

Brad
nagios.jpg

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 2:33 pm
by scottwilkerson
This is super weird, your command view is blank...

Are you sure that the settings are correct for the command check_nt
Config -> Core Config Manager -> Commands

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 2:37 pm
by kiddbios
I just installed the NS++ client on a Windows host. I forwarded port 12489 and verified that I could telnet to port 12489, indicating a successful firewall configuration. I then attempted to create a new monitored Windows server on Nagios XI. I pointed it to the external IP and selected the defaults with no additional services or monitoring parameters. It could not connect to the client and the status for ping and all services shows as down. I must be doing something incorrectly. Anything local I can monitor fine. I can also monitor things that I am connected to via IPSEC VPN tunnels, which is what I'm trying to get away from with Zenoss and SNMP. Any light you can shed is greatly appreciated.

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 2:39 pm
by kiddbios
I have no idea why, but the command view did not come over in the screenshot. There is data there. It is as follows:

$USER1$/check_nt -H $HOSTADDRESS$ -p $ARG8$ -s $USER8$ -v $ARG1$ $ARG2$

Thanks,

Brad

Re: Monitoring remote servers 2

Posted: Thu Feb 02, 2012 3:44 pm
by lmiltchev
I changed the check_nt command from $ARG3$ to $ARG8$ and then added 11609 (the port I'm listening on) in the $ARG8$ field under the check_nt command on each service that is to be monitored. The host still shows as being down. When I go to the host detail I have an error that says: "The port must be an integer"
See if you have $ARG8$ defined in the "/usr/local/nagios/etc/resource.cfg" file. You may have you use something else instead. Usually you get "The port must be an integer" error when the "-p" argument is used twice - in the service definition AND in the command definition.