Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nagios administration[resolved]
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
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Thu Jul 16, 2009 6:28 pm    Post subject: nagios administration[resolved] Reply with quote

Obviously these are noob questions :D
I have read the how-to even though its under construction, but it did helped me alot until now finally I can monitor my machine with nagios.
Unfortunately, on my client I get lots of this line on my logs.

1.
Quote:
Jul 16 20:00:59 fileserver nagios: Error: Could not open check result queue directory '/var/nagios/spool/checkresults' for reading.
Jul 16 20:01:09 fileserver nagios: Error: Could not open check result queue directory '/var/nagios/spool/checkresults' for reading.
Jul 16 20:01:19 fileserver nagios: Error: Could not open check result queue directory '/var/nagios/spool/checkresults' for reading.
Jul 16 20:01:29 fileserver nagios: Error: Could not open check result queue directory '/var/nagios/spool/checkresults' for reading.


I have tried to create the dir and give it 777 mode, but it still pops up.If someone could help with this error I would really help.This programs is cool, but very unfriendly to noobs :lol:

2.
Apart from that, I am still left clueless on snmp.Which lead to the fact that my router cant be monitored.
Quote:
[07-16-2009 20:21:23] SERVICE NOTIFICATION: nagiosadmin;router;Port 1 Link Status;UNKNOWN;notify-service-by-email;SNMP problem - No data received from host
Service Notification[07-16-2009 20:12:13] SERVICE NOTIFICATION: nagiosadmin;router;Uptime;UNKNOWN;notify-service-by-email;SNMP problem - No data received from host


Checking with snmpwalk:
Quote:
>snmpwalk -v 1 -c public router
#Timeout: No Response from router


Anyone with a sample snmp.conf to share?

Thanks for the help....thats a lot of question in one thread, but this nagios ate the whole day here ....

Cheers
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com


Last edited by muhsinzubeir on Fri Jul 17, 2009 2:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Fri Jul 17, 2009 6:49 am    Post subject: Reply with quote

Hi,

for the first issue, can you post "ls -la /var/nagios/spool/checkresults" please.

for the second issue, my basic snmpd.conf:

Code:

com2sec readonly  default         public
group MyROSystem v1        paranoid
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite
view all    included  .1                               80
view system included  .iso.org.dod.internet.mgmt.mib-2.system
access MyROSystem ""     any       noauth    exact  system none   none
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
disk /


bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Fri Jul 17, 2009 8:22 am    Post subject: Reply with quote

Quote:
# ls -la /var/nagios/spool/checkresults
-rw-r--r-- 1 root root 2 Jul 16 20:19 /var/nagios/spool/checkresults


I will test if i can get lucky with yr snmp.conf....by the way the dir spool and checkresults were created by me after I read my logs and see the error

Thanks mate...really appreciate...
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Fri Jul 17, 2009 8:57 am    Post subject: Reply with quote

Hi,

since your checkresults is a file not a directory, you should remove it and create a directory instead. Change the owner to the nagiosuser and you should be fine.
Code:

$ rm -rf /var/nagios/spool/checkresults
$ mkdir -p /var/nagios/spool/checkresults
$ chown nagios /var/nagios/spool/checkresults -R


bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Fri Jul 17, 2009 12:24 pm    Post subject: Reply with quote

Thanks for the tip, that worked no more more errors on my log about that Q1....its a dir instead of a file :)
By the way, the issue of snmp I am still working on it.But I am amazed that I can only collect info from localhost only as it can be seen here.
Code:
>snmpget -v1 -Cf -c public localhost system.sysDescr.0
#SNMPv2-MIB::sysDescr.0 = STRING: Linux gendesktop 2.6.30-gentoo-r2 #1 SMP Thu Jul 16 12:26:32 CEST 2009 i686



Any other device router or gentoo box,

Code:
>snmpget -v1 -Cf -c public 192.168.1.34 system.sysDescr.0
#Timeout: No Response from 192.168.1.34.


I think I will also play to collect Bandwidth, sounds like a pretty cool stuffs to play with :P

Edit:
***I think clients arent correctly configured, router is giving responses via snmp now :wink:
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com


Last edited by muhsinzubeir on Fri Jul 17, 2009 1:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Fri Jul 17, 2009 12:54 pm    Post subject: Reply with quote

Do you have firewall rules running on 192.168.1.34? If yes, you need to open port 161 for lan access. If you have no firewall running on this port, check whether your snmpd is running on all interfaces or just localhost.

bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Fri Jul 17, 2009 1:29 pm    Post subject: Reply with quote

Sorry we were writting simultaneously....
I have responses now from my router so the uptime and link status all good now....problem was on the router actually, that its snmp is not configured to deliver data to the central box.
Thanks I really appreciate your help....
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Mon Jul 20, 2009 3:12 pm    Post subject: Reply with quote

I am totally lost to monitor my server with nrpe, I get
Quote:
CHECK_NRPE: Socket timeout after 30 seconds.

It was 10s, i have changed to 30 still same problem.I have played with my firewall on the router no luck.

On the remote gentoo box, everything is working:
Quote:
#netstat -at |grep nrpe
tcp 0 0 *:nrpe *:* LISTEN


Quote:
#ps axuw |grep nrpe
root 11420 0.0 0.0 1928 520 pts/0 S+ 17:03 0:00 grep --colour=auto nrpe
nagios 30110 0.0 0.0 1908 660 ? Ss Jul19 0:04 /usr/bin/nrpe -c /etc/nagios/nrpe.cfg --daemon


Any idea what am i missing on this.It seems like snmp from the central box to this server works perfectly as it can be seen here:
Quote:
#snmpwalk -v 1 -c public fileserver hrSystemUptime.0
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (75798970) 8 days, 18:33:09.70


May be I will spend time on this method rather than nrpe :lol:
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Mon Jul 20, 2009 8:44 pm    Post subject: Reply with quote

You can try to run the check_nrpe command by hand. Usually it fails either coz SSL is enabled and not used or the other way around.

bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Tue Jul 21, 2009 1:49 pm    Post subject: Reply with quote

Testing nrpe from my monitoring machine:

I can run it from the command line as
Quote:
#/usr/lib/nagios/plugins/check_nrpe -H fileserver -c check_load
OK - load average: 0.00, 0.00, 0.00|load1=0.000;15.000;30.000;0; load5=0.000;10.000;25.000;0; load15=0.000;5.000;20.000;0;


But not as check_nrpe:
Quote:
#check_nrpe -H fileserver -c check_load
bash: check_nrpe: command not found


Could this be the problem?

By the way thanks for the tip of ssl, I have disabled it on all my boxes as I am not using it.
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Tue Jul 21, 2009 2:06 pm    Post subject: Reply with quote

hold on...it might be working this time....ive tried to add the command in command.cfg :lol:
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Tue Jul 21, 2009 3:02 pm    Post subject: Reply with quote

Thanks bbgermany...really appreciate, this nagios needs alot of concentration to get it to work.But I think I am almost happy now, probably with few changes to come on my config...ill be monitoring this box closely.

By the way, my problem was command definition I think.So I placed this on /etc/nagios/objects/commands.cfg
Quote:
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


And nrpe started to work as expected....here is my to get me started on monitoring my box:
Quote:
###############################################################################
###############################################################################
#
# HOST DEFINITION FOR SERVER
#
###############################################################################
###############################################################################

# Define a host for the local machine

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name fileserver
alias fileserver
address 192.168.1.XX
}



###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################

# Define an optional hostgroup for Linux machines

define hostgroup{
hostgroup_name fileserver ; The name of the hostgroup
alias MZALENDO LINUX SERVER ; Long name of the group
members fileserver ; Comma separated list of hosts that belong to this group
}



###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################


#LOAD
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description LOAD
check_command check_nrpe!check_load!5.0,4.0,3.0!10.0,6.0,4.0
}

#USERS
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description USERS
check_command check_nrpe!check_users
}

#ROOT
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description ROOT
check_command check_nrpe!check_disk!20%!10%!/
}

#Total procs
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description Total Procs
check_command check_nrpe!check_total_procs!250!400!RSZDT
}

#zombie procs
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description Zombie Procs
check_command check_nrpe!check_zombie_procs
}


P:S
PLEASE DONT USE ANY INFO AGAINST ME :D

Edit:
Red color isnt working yet on this sample file :lol:
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Tue Jul 21, 2009 6:38 pm    Post subject: Reply with quote

Hi,

check_nrpe works in a different way. You have to define what you want to check this way:

On the Nagios Server (/etc/nagios3/conf.d/check_commands.cfg):
Code:

define command {
        command_name nrpe_check_root
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_root -n
        }


On the nrpe client (/etc/nagios/nrpe.cfg):
Code:

command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /


The Nagios server sends a nrpe command to the nrpe client, where a local plugin (yes, you need the nagios plugins installed on the client) and runs it. Then the nrpe process sends the infomation grabbed via the plugin to the Nagios server.

bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Tue Jul 21, 2009 8:48 pm    Post subject: Reply with quote

Thanks alot bbgermany...I realized that the check_disk has to be implimented also on the client.
Well I will see tomorrow if I can have a short summery on the whole journey to save somebody else's time on this software.
Its pretty powerful tool I guess....I just wanted to explore it for while...and its for the first time i got a place for it.

Cheers...
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Wed Jul 22, 2009 6:09 am    Post subject: Reply with quote

Hi,

you're always welcome. It took me ages to find out how nagios works as I setup it for the first time :D Until now im not really able to use snmp correctly ;)

bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Wed Jul 22, 2009 1:05 pm    Post subject: summery of nagios setups Reply with quote

Seting up nagios, involves central PC that monitoring software nagios is installed and couple devices that we are monitoring.
In this scenario we 2 computers and 1 router.One computer called gendesktop is the central command center that nagios is installed to monitor itself, router and 1 remote server(fileserver).
Computer names:

Central command center-gendesktop
*Router-router
*Gentoo Linux Server-fileserver
*Central command-gendesktop

Preparations:
***PREPARE THE ROUTER
Make sure you have allowed snmp on "remote management" section of the router device.
Atleast on my device this was not on by default.

***PREPARE THE REMOTE BOX-FILESERVER:
On the fileserver,Check if necessary plugins like snmp, nrpe are installed on the this box.Feel free to remove some of them.

Code:
#emerge -pv nagios-plugins
net-analyzer/nagios-plugins-1.4.13-r4  USE="ipv6 ldap mysql nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh radius samba snmp suid ups -postgres -ssl" 0 kB


Create commands on for the services that we want to monitor from this box:
Configuration file for npre lives /etc/nagios/nrpe.cfg, I ignored all other stuffs and change only the commands.

Quote:
#Examples
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200

#disk
command[check_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_home]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /home


Start the deamon for this nrpe, and put it in the default run-level
Code:
/etc/init.d/nrpe start && rc-update add nrpe default


I also added this on /etc/services {no idea if its needed :)}
Quote:
nrpe 5666/tcp


Verify nrpe on this client is all set:
Code:
#ps axuw | grep nrpe
#netstat -at | grep nrpe


############################################COMMAND CENTER-GENDESKTOP##########################################
Objective, we want to monitor link status, ping and Uptime.There are more stuffs here can be monitored like bandwidth using mrtg, but we leave that to readers :)
Configuration on the gendesktop:
We need nagios with all its plugin, so enable its USE flags and install it.
#emerge -av nagios

P:S
Check if necessary plugins like snmp, nrpe are installed on the plugins
Code:
#emerge -pv nagios-plugins
net-analyzer/nagios-plugins-1.4.13-r4  USE="ipv6 ldap mysql nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh radius samba snmp suid ups -postgres -ssl" 0 kB


WEB INTERFACE:
The web interface is cgi style, and it lives in on /usr/lib/nagios/cgi-bin.
Not so sure if .htaccess was there I created, but verify it, if not there create one.

#nano -w /usr/lib/nagios/cgi-bin/.htaccess
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/auth.users
Require valid-user


Restrict access to your nagios /etc/apache2/modules.d/99_nagios3.conf:
Quote:
#nano -w /etc/apache2/modules.d/99_nagios3.conf
<IfDefine NAGIOS>
ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/
<Directory "/usr/lib/nagios/cgi-bin/">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /nagios /usr/share/nagios/htdocs
<Directory "/usr/share/nagios/htdocs">
AllowOverride AuthConfig
Order allow,deny
Allow from 127.0.0.1 192.168.1.1/24
</Directory>
</IfDefine>


Create user to access your web-interface:
Quote:
# htpasswd2 -c /etc/nagios/auth.users nagiosadmin

Test if web-interface is working, shoot this on your browser http://localhost/nagios

Now lets test communication to the router, if communication is working we continue to create object file for this router.

Test SNMP WITH THE ROUTER:
Quote:
#snmpwalk -v 1 -c public router

You should get lots of output data here, if it doesnt work.If it doesnt work consult troubleshooting area below on the pdf file called NRPE.pdf in the resource links below.

If you do have communication there, lets create the object file for this router:
Create the dir:
Code:
#mkdir /etc/nagios/objects/routers


and create this file in there router.cfg.
Quote:
###############################################################################
###############################################################################
#
# HOST DEFINITIONS-ROUTER
#
###############################################################################
###############################################################################
# Define the switch that we'll be monitoring

define host{
use generic-switch ; Inherit default values from a template
host_name router ; The name we're giving to this switch
alias Linksys SRW224P Switch ; A longer name associated with the switch
address 192.168.1.254 ; IP address of the switch
hostgroups gendesktop,mzalendo.net,switches ; Host groups this switch is associated with
}

###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS-ROUTER
#
###############################################################################
###############################################################################

# Create a new hostgroup for switches

define hostgroup{
hostgroup_name switches ; The name of the hostgroup
alias Network Switches ; Long name of the group
}




###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS-ROUTER
#
###############################################################################
###############################################################################
# Create a service to PING to switch
define service{
use generic-service ; Inherit values from a template
host_name router ; The name of the host the service is associated with
service_description PING ; The service description
check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}


# Monitor uptime via SNMP
define service{
use generic-service ; Inherit values from a template
host_name router
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}

# Monitor Port 1 status via SNMP
define service{
use generic-service ; Inherit values from a template
host_name router
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}

# Monitor bandwidth via MRTG logs
#define service{
# use generic-service ; Inherit values from a template
# host_name router
# service_description Port 1 Bandwidth Usage
# check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.254.log!AVG!1000000,1000000!5000000,5000000!10
# }


Verify that no problem no errors in your config files:
Code:
#nagios -v /etc/nagios/nagios.cfg


If no problem restart nagios deamon.
Code:
#/etc/init.d/nagios restart


REMOTE BOX FILESERVER OBJECT FILE:
creat the directy /etc/nagios/objects/servers/ and put this file in it fileserver.cfg
Quote:
###############################################################################
###############################################################################
#
# HOST DEFINITION FOR FILESERVER
#
###############################################################################
###############################################################################

# Define a host for the local machine

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name fileserver
alias fileserver
address 192.168.1.xx
}



###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################

# Define an optional hostgroup for Linux machines

define hostgroup{
hostgroup_name fileserver ; The name of the hostgroup
alias MZALENDO LINUX SERVER ; Long name of the group
members fileserver ; Comma separated list of hosts that belong to this group
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################

#LOAD
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description LOAD
check_command check_nrpe!check_load!5.0,4.0,3.0!10.0,6.0,4.0
}

#USERS
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description USERS
check_command check_nrpe!check_users
}

#ROOT
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description ROOT
check_command check_nrpe!check_root!20%!10%!
}


#HOME
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description HOME
check_command check_nrpe!check_home!20%!10%!
}


#Total procs
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description Total Procs
check_command check_nrpe!check_total_procs!250!400!RSZDT
}

#zombie procs
define service{
use generic-service ; Name of service template to use
host_name fileserver
service_description Zombie Procs
check_command check_nrpe!check_zombie_procs
}gendesktop muhsin #



Verify that no problem no errors in your config files:
Code:
#nagios -v /etc/nagios/nagios.cfg


If no problem restart nagios deamon.
Code:
#/etc/init.d/nagios restart





TROUBLESHOOTING



RESOURCES:
http://www.gentoo.org/doc/en/nagios-guide.xml
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
http://www.nagios.org/
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


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

PostPosted: Wed Jul 22, 2009 1:16 pm    Post subject: Reply with quote

Hi,

one little correction: nrpe does not need snmp. its using its own protocol to get the data!

bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Wed Jul 22, 2009 2:22 pm    Post subject: Reply with quote

Thats true, in my setup I mixed both 2 , router needed snmp and fileserver uses nrpe.
I think snmp is much better way, but I still need more time to learn how to snmp with my gentoo box... :lol:
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Wed Jul 22, 2009 2:44 pm    Post subject: Reply with quote

I have tried to use snmp to my gentoo server (fileserver) to get uptime and I just added this service, and it works like a charm :)
Quote:
#uptime
define service{
use generic-service ; Inherit values from a template
host_name fileserver
service_description Uptime
check_command check_snmp!-C public -o hrSystemUptime.0
}

So probably, snmp is the best approaches in that scenario because its available on both clients (router+gentoo server).....

Cheers...
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
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