Installing Nagios distant client

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.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Installing Nagios distant client

Post by ziedmahjoub »

Hello,

i have installed nagios core 4.0.8 with nagios-plugins 2.0.3 , and i'm able to monitor machines that are in our local company network .
Now i want to monitor distant clients (clients that are not in our local networks) , i searched in internet for tutorials or some hints but i didn't find .

So i just need to change the host ip address in the file "windows.cfg" to put the public IP address of my distant host and its ok ?!
Or there is other changes ?

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Installing Nagios distant client

Post by tmcdonald »

If the remote machine you wish to monitor will respond to that public IP and has the proper firewall ports open, then yes this should work.
Former Nagios employee
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: Installing Nagios distant client

Post by ziedmahjoub »

tmcdonald , my problem is if i want to monitor a company composed of 10 machines and using a single Public ip to access the internet , how can i monitor these 10 machines remotely ?

This is my main problem now
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Installing Nagios distant client

Post by slansing »

I would set up a Core instance on that network, and forward the check results to the main one. You could alternatively set NRPE up in server mode and have it collate your check results, then your main Core server can pull them all up.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: Installing Nagios distant client

Post by ziedmahjoub »

slansing wrote:I would set up a Core instance on that network, and forward the check results to the main one. You could alternatively set NRPE up in server mode and have it collate your check results, then your main Core server can pull them all up.
You mean i just need to monitor the server which is collecting informations of the local machines , right ?
Distributed servers
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Installing Nagios distant client

Post by tmcdonald »

Sort of. You can either install a Nagios Core/XI system within the remote network, and have that machine send the results back to your main Nagios server, or you can install something like NRPE (Nagios Remote Plugin Executor) which acts as a sort of proxy between the networks and executes the checks on Nagios' behalf.
Former Nagios employee
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Installing Nagios distant client

Post by slansing »

Correct, or you could set those systems up to passively send check results to your main server, the main issue is it's all coming from one address, which is why I recommended using a distributed core environment.
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: Installing Nagios distant client

Post by ziedmahjoub »

tmcdonald and slansing thanks ,the idea is very clear .
Since i'm new to the nagios i have some other questions :

Code: Select all

define command{
   command_name   check_nt
   command_line   $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$
   }
1- How can i modify this command if i want machines with different PASSWORD , i just need to copy paste the define command code (like above) and change the password in the

Code: Select all

-s PASSWORD
because i dont want that all the machines got the same password .
2- also if i want different ports , is it the same logic ?
3- Can i monitor remote company machines which connect to the internet with a single IP address by just changing the default port (12489) ?

Thanks tmcdonald and slansing
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Installing Nagios distant client

Post by slansing »

You could place ARG1 where password is, then ARG2 where ARG1 was, and then add an ARG3, that way, you can always define your password in ARG1 without having to create separate commands. In the future, if your questions stray away from the original topic please open a new thread to keep them separate, thanks!
ziedmahjoub
Posts: 142
Joined: Fri Jan 16, 2015 5:22 am

Re: Installing Nagios distant client

Post by ziedmahjoub »

Thanks slansing , and sorry , i will put it in a new thread .

So the command will be like that ? :

Code: Select all

define command{
   command_name   check_nt
   command_line   $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s $ARG1$ -v $ARG2$ $ARG3$
   }
Locked