LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-04-2010, 02:49 PM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Rep: Reputation: 99
Unable to view remote hosts details in Nagios Browser Page


Dear All,

I am new to Nagios and I have configured Nagios Server and Client on my RHEL 5.4 machines using these links and help html files in tar balls.

http://www.thegeekstuff.com/2008/05/...configuration/
http://www.thegeekstuff.com/2008/06/...ing-nagios-30/


I have this scenario.

Nagios Server - 192.168.1.200
Nagios Client - 192.168.1.201
(This is the remote-host I am trying to monitor)


I firmly believe I have at least configured it right as this command on Nagios Server does not show any errors.

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


Code:
[root@ser ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.2.2
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 09-01-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 8 services.
Checking hosts...
        Checked 1 hosts.
Checking host groups...
        Checked 1 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 1 contacts.
Checking contact groups...
        Checked 1 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 24 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
[root@ser ~]#

Also, my addone nrpe daemon is working correctly as I am able to run the below command succesfully.

Code:
[root@ser ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.201
NRPE v2.12
Also, the below commands on remote-host (192.168.1.201) are running properly.

Code:
[root@ser ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
USERS OK - 1 users currently logged in |users=1;5;10;0
[root@ser ~]#
[root@ser ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -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;
[root@ser ~]#
[root@ser ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_sda
DISK OK - free space: / 5290 MB (62% inode=94%);| /=3169MB;7136;8028;0;8920
[root@ser ~]#
[root@ser ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs
PROCS OK: 79 processes
[root@ser ~]#
[root@ser ~]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs
PROCS OK: 0 processes with STATE = Z
[root@ser ~]#
Now, my problem starts here. Though, as per manuals I have correct entries in my remotehost.cfg, still I am unable to view it in my browser at http://192.168.1.200/nagios/. Please see attached snapshot.

Code:
[root@ser ~]# cat /usr/local/nagios/etc/objects/remotehost.cfg
define host{
use linux-server
host_name ser.box3.com
alias Remote Host
address 192.168.1.201
contact_groups admins
}


define service{
use generic-service
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_disk
}
Attached Images
File Type: jpg Error.JPG (103.2 KB, 15 views)
 
Old 09-05-2010, 07:44 PM   #2
kforbus
Member
 
Registered: Sep 2009
Location: Maryland
Distribution: Slackware
Posts: 68

Rep: Reputation: 28
I always love to see people starting to use Nagios. With all the available plugins and addons, there isn't much you can't do with it. I should probably try using NRPE sometime as I've always done most of my checks using the Check By SSH plugin.

Anyway, on to your problem. I always like to try the simple things first, so with that in mind, have you added a cfg_file=/etc/nagios/objects/remotehost.cfg entry to /etc/nagios/nagios.cfg? Or if you're going to be dumping most of your config files into the /etc/nagios/objects directory you could just add a line like cfg_dir=/etc/nagios/objects to nagios.cfg. Without one of these entries, Nagios won't know it's supposed to process your remotehost.cfg file and will just ignore it.

Just something to check. If you already have that in place, we can try something else.

EDIT: The directories I mentioned above will probably be /usr/local/nagios/etc for you instead of just /etc, so hopefully that won't create too much confusion.

Last edited by kforbus; 09-05-2010 at 07:49 PM.
 
Old 09-06-2010, 12:35 PM   #3
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Original Poster
Rep: Reputation: 99
Thumbs up

Quote:
Originally Posted by kforbus View Post
I've always done most of my checks using the Check By SSH plugin.
Is it easy to use ? I will also try this.

Quote:
Originally Posted by kforbus View Post
Anyway, on to your problem. I always like to try the simple things first, so with that in mind, have you added a cfg_file=/etc/nagios/objects/remotehost.cfg entry to /etc/nagios/nagios.cfg?
Many thanks to you kforbus.
This was the problem. I have added this line
cfg_file=/usr/local/nagios/etc/objects/remotehost.cfg
to
/usr/local/nagios/etc/nagios.cfg

I am now can see my remote host (192.168.1.201 ser.box3.com). Please see attached pic.

But, the problem is that I cannot see other details or checks I have done for this remotehost except the critical alerts like server is UP or DOWN.

Actually, I have tested it by creating the below service /usr/local/nagios/etc/objects/remotehost.cfg on Nagios Server (192.168.1.200)

Code:
define service{
use generic-service
contact_groups admins
service_description /dev/sda1 Free Space
check_command check_nrpe!check_sda1
}
And, the corresponding check in /usr/local/nagios/etc/nrpe.cfg in RemoteHost 192.168.1.201
Code:
command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 97% -c 98% -p /dev/sda1
As per manuals, it should send a warning alert when my disk is 3% utilized and a critical alert when my disk is 2% utilized, but even though my /dev/sda1 is 38% utilized, I am not getting any alerts.
Code:
[root@ser ~]# hostname
ser.box3.com
[root@ser ~]# df -kh /dev/sda1
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             8.8G  3.2G  5.2G  38% /
Also, after making the above changes, I have restarted Nagios Service in Nagios Server and xinetd Service on RemoteHost.

Any ideas brother ?
Attached Images
File Type: jpg Error_1.JPG (131.4 KB, 19 views)
 
Old 09-07-2010, 01:59 PM   #4
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Original Poster
Rep: Reputation: 99
Thumbs up Mission Accomplished

Hi Kforbus,

I am glad to tell you that finally I have made it working, though it took me few hours.

Well, the problem was with my commands.cfg. I just reconfigured it and tried running
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

This was giving me the below errors :-
Code:
Error: Service check command 'check_nrpe' specified in service '/dev/sda1 Free Space' for host 'ser.box3.com' not defined anywhere!
Error: Service check command 'check_nrpe' specified in service 'Checking HTTP' for host 'ser.box3.com' not defined anywhere!
        Checked 10 services.
I further digged into it and found that I had a misplaced path of commands.cfg, this was not included in the How-To which I was referring.

It was /usr/local/nagios/etc/commands.cfg
instead of
/usr/local/nagios/etc/objects/commands.cfg


I am happy man now. Many thanks for your time and help.

Now, I will further dig more options of it, Will trouble you again if I will get stuck somewhere

Last edited by vikas027; 09-07-2010 at 02:07 PM.
 
Old 09-07-2010, 02:09 PM   #5
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Original Poster
Rep: Reputation: 99
And now I also understood what check_by_ssh plugin you were talking about.

It works somewhat like this.

Code:
[root@ser ~]# /usr/local/nagios/libexec/check_procs  -w 2:6 -c 2:1024 -C mingetty
PROCS OK: 6 processes with command name 'mingetty'
[root@ser ~]#
[root@ser ~]#
[root@ser ~]#  /usr/local/nagios/libexec/check_by_ssh -p 22 -l root -H localhost -C '/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /'
root@localhost's password:
DISK OK - free space: / 5265 MB (62% inode=94%);| /=3194MB;7136;8028;0;8920
 
Old 09-07-2010, 06:22 PM   #6
kforbus
Member
 
Registered: Sep 2009
Location: Maryland
Distribution: Slackware
Posts: 68

Rep: Reputation: 28
Hey, I'm glad you got your problem figured out. And yes, it was the check_by_ssh plugin I was referring to in my earlier comment. I like it because it is pretty easy to setup on the remote machines -- just add a nagios user, create public/private keys, and add whatever plugins you want to run. In retrospect, setting up NRPE is probably just as easy if not easier, but everybody has their own way of doing things. Well, good luck to you and I hope you enjoy Nagios.
 
Old 09-08-2010, 12:44 PM   #7
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Original Poster
Rep: Reputation: 99
I also find check_by_ssh pretty easy
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox browse box - view details ivanatora Linux - Software 1 04-06-2009 03:49 PM
how to view the log details of samba users sravanth.svk Fedora 0 10-26-2006 09:31 AM
Internet connection problem, able to ping but unable to get web page in browser rajnishmishra Linux - Networking 13 07-15-2004 12:54 AM
Unable to view web page from remote machine kiddy Linux - Networking 2 04-14-2004 09:06 PM
web server, unable to view test page gigya Linux - Software 1 01-30-2004 10:34 AM


All times are GMT -5. The time now is 10:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration