Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nagios remote host monitor
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Fri Nov 23, 2012 7:09 pm    Post subject: nagios remote host monitor Reply with quote

I'm trying to configure nagios to monitor the remote host but it is up-hill battle.

Gentoo instructions are outdated:
http://www.gentoo.org/doc/en/nagios-guide.xml

I have emerged "nrpe" and started on both server and client, is it correct?

On the server I have created directory:
/etc/nagios/objects
does this directory have to have ownership "nagios:nagios" ?

Inside this directory I have have created files:
Code:
nrpe-command.cfg
define command {
  command_name check_nrpe
  command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Code:
nrpe-hosts.cfg
define host {
  use linux-server
  host_name clinic-atom
  alias Gentoo Linux Web Server
  address 192.168.141.1
}
Code:
nrpe-services.cfg
define service {
  use generic-service
  host_name clinic-atom
  service_description Current Load
  check_command check_nrpe!check_load
}

define service {
  use generic-service
  host_name clinic-atom
  service_description Root Partition
  check_command check_nrpe!check_disk
}


On the client I just emerge nrpe and started it. Why isn't it working?
Is there any easier package to use?
_________________
#Thelma
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 738

PostPosted: Fri Nov 23, 2012 8:52 pm    Post subject: Reply with quote

The default configuration may allow access from localhost only.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Fri Nov 23, 2012 9:42 pm    Post subject: Reply with quote

Princess Nell wrote:
The default configuration may allow access from localhost only.


Yes, I know that. That is how I had configured.
My question is how to enable remote host to talk to local server that monitors it, that part is not clear to me.
_________________
#Thelma
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 738

PostPosted: Sat Nov 24, 2012 10:35 am    Post subject: Reply with quote

You need to allow remote access on the client. The check_nrpe plugin on the server needs to communicate with the nrpe daemon on the client.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Sat Nov 24, 2012 3:15 pm    Post subject: Reply with quote

Princess Nell wrote:
You need to allow remote access on the client. The check_nrpe plugin on the server needs to communicate with the nrpe daemon on the client.


I think I figure it out.
According to nagios documentation, the nrpe suppose to be installed on the client and since "nrpe" installs "check_nrpe" it must be emerged on the monitoring server as well. As "check_nrpe" connect to nrpe on the client.
In addition I need to create "nagios" user and group on the client.

The whole setup is getting too complicated and it is hard to obtain any support or answer anywhere on nagios, so I gave up.

I was trying to use it to monitor Asterisk server on the remote client as it sometimes I can not restart it, I get:
Code:
/etc/init.d/asterisk restart
 * Caching service dependencies ...           [ ok ]
 * Killing wrapper script ...                 [ ok ]
 * Stopping asterisk PBX gracefully ...

* Waiting for asterisk to shutdown .............................................................
 * Failed.


When I run /etc/init.d/asterisk status
I get: "* status: started"

At this point I have to kill the process ID
"zap" it (/etc/init.d/asterisk zap)
and restart it.
_________________
#Thelma
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 738

PostPosted: Sat Nov 24, 2012 8:40 pm    Post subject: Reply with quote

I'm pretty emerge does all the right things. I installed nrpe temporarily to check the default config file, then unmerged. Still have:
Code:

# grep nagios /etc/[ps][ah][as]*
/etc/passwd:nagios:x:120:993:added by portage for nagios-plugins:/var/nagios/home:/bin/bash
/etc/shadow:nagios:!:15667::::::
#

nagios-plugins are a required dependency of nrpe, so it gets installed when you emerge nrpe. Normally :)
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1785
Location: Oranienburg/Germany

PostPosted: Tue Nov 27, 2012 8:23 am    Post subject: Reply with quote

Joseph_sys wrote:
Princess Nell wrote:
You need to allow remote access on the client. The check_nrpe plugin on the server needs to communicate with the nrpe daemon on the client.


I think I figure it out.
According to nagios documentation, the nrpe suppose to be installed on the client and since "nrpe" installs "check_nrpe" it must be emerged on the monitoring server as well. As "check_nrpe" connect to nrpe on the client.
In addition I need to create "nagios" user and group on the client.

The whole setup is getting too complicated and it is hard to obtain any support or answer anywhere on nagios, so I gave up.

I was trying to use it to monitor Asterisk server on the remote client as it sometimes I can not restart it, I get:
Code:
/etc/init.d/asterisk restart
 * Caching service dependencies ...           [ ok ]
 * Killing wrapper script ...                 [ ok ]
 * Stopping asterisk PBX gracefully ...

* Waiting for asterisk to shutdown .............................................................
 * Failed.


When I run /etc/init.d/asterisk status
I get: "* status: started"

At this point I have to kill the process ID
"zap" it (/etc/init.d/asterisk zap)
and restart it.


Hi,

nrpe works different from the normal checks. The Nagios Server pokes via a local nrpe client the remote nrpe client to run the check command on the host where you need a check.

Code:

NAGIOS Server -> nrpe-nagios-server -> nrpe-client -> check_command


So if you want to check for the load on a remote server you need nrpe and the nagios-plugins installed there. Then check your nrpe.cfg file for the line similiar to the following:

Code:

command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20


so if you run on the Nagios Server a definition for like this:

Code:

nrpe-services.cfg
define service {
  use generic-service
  host_name clinic-atom
  service_description Current Load
  check_command check_nrpe!check_load
}


it will run the check_load command between the brackets after command in your nrpe.cfg file (as long as the nrpe deamon is running on the client).

bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum