Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[SOLVED] nagios/nrpe problem

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
24 posts • Page 1 of 1
Author
Message
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

[SOLVED] nagios/nrpe problem

  • Quote

Post by kolcon » Mon Dec 07, 2009 7:43 am

I have a strange problem with nrpe...

######
on the remote monitored host :
net-analyzer/nagios-nrpe-2.12-r102 USE="command-args ssl"

/etc/nagios/nrpe.cfg:
command[check_home]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /home

running :
/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /home
DISK WARNING - free space: /home 329711 MB (17% inode=-);| /home=1509720MB;1471544;1655487;0;1839431
######

on the "central" host:
# /usr/lib/nagios/plugins/check_nrpe -H ip_of_remote
NRPE v2.12

# /usr/lib/nagios/plugins/check_nrpe -H ip_of-remote -c check_home
NRPE: Unable to read output


Any ideas why? should I open a bug?
Thank you for any ideas...
Last edited by kolcon on Wed Dec 09, 2009 8:19 am, edited 1 time in total.
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 11:37 am

Hi,

My check_disk binary is here:

/usr/nagios/libexec/check_disk

Check the path is correct on your remote host.

Rich.
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 11:59 am

richard.scott wrote:Hi,

My check_disk binary is here:

/usr/nagios/libexec/check_disk

Check the path is correct on your remote host.

Rich.
libexec -> /usr/lib/nagios/plugins
it is the same thing....
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 12:41 pm

Is there anything in the logs on the remote host?
I had something from nrpe in there when I had this problem.
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 12:43 pm

richard.scott wrote:Is there anything in the logs on the remote host?
I had something from nrpe in there when I had this problem.
Not much :
Dec 7 12:58:42 ricbhost nrpe[2867]: Connection from XXX.XXX.XXX.XXX port 47073
Dec 7 12:58:42 ricbhost nrpe[2867]: Host address is in allowed_hosts
Dec 7 12:58:42 ricbhost nrpe[2867]: Handling the connection...
Dec 7 12:58:42 ricbhost nrpe[2867]: Host is asking for command 'check_disk' to be run...
Dec 7 12:58:42 ricbhost nrpe[2867]: Running command: /usr/nagios/libexec/check_disk -w 10 -c 5 -p /
Dec 7 12:58:42 ricbhost nrpe[2867]: Command completed with return code 3 and output:
Dec 7 12:58:42 ricbhost nrpe[2867]: Return Code: 3, Output: NRPE: Unable to read output
Dec 7 12:58:42 ricbhost nrpe[2867]: Connection from XXX.XXX.XXX.XXX closed.
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 12:49 pm

kolcon wrote:libexec -> /usr/lib/nagios/plugins
it is the same thing....
Not if its a recent install on Gentoo.

on a recent install of nagios-plugins they all go in /usr/lib/nagios/plugins

I'd double check to make sure.

Rich.
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 12:55 pm

richard.scott wrote:
kolcon wrote:libexec -> /usr/lib/nagios/plugins
it is the same thing....
Not if its a recent install on Gentoo.

on a recent install of nagios-plugins they all go in /usr/lib/nagios/plugins

I'd double check to make sure.

Rich.
Yes, they are there in /usr/lib/nagios/plugins, the other directory is just a symlink

# emerge -pv nagios-plugins

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] net-analyzer/nagios-plugins-1.4.14 USE="ldap mysql nagios-ping nagios-ssh samba snmp ssl suid -ipv6 -nagios-dns -nagios-game -nagios-ntp -postgres -radius -ups" 0 kB
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 1:02 pm

kolcon wrote:Yes, they are there in /usr/lib/nagios/plugins, the other directory is just a symlink
How did you get the symlink then?

i've just emerge these:

Code: Select all

 # equery list nagios
[ Searching for package 'nagios' in all categories among: ]
 * installed packages
[I--] [  ] net-analyzer/nagios-nrpe-2.12-r102 (0)
[I--] [  ] net-analyzer/nagios-plugins-1.4.13-r1 (0)
and I don't have a /usr/nagios/libexec symlink 8O

Code: Select all

# cd /usr/nagios/libexec
-su: cd: /usr/nagios/libexec: No such file or directory
What does this show on your remote system:

Code: Select all

 # equery files nagios-plugins | grep disk
/usr/lib/nagios/plugins/check_disk
Rich
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 1:05 pm

good question about the symlink ;)

# equery files nagios-plugins | grep disk
/usr/lib/nagios/plugins/check_disk
/usr/lib/nagios/plugins/check_disk_smb
/usr/lib/nagios/plugins/contrib/check_snmp_disk_monitor.pl
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 1:09 pm

Perhaps NRPE doesn't like symlinks?
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 1:19 pm

richard.scott wrote:Perhaps NRPE doesn't like symlinks?
Can be, however when I change it to:
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

it still behaves the same...

When I run the command directly under root, it prints out DISK OK etc.... I wonder if it
could be permissions problem?

nrpe is running under user nagios, all the plugins are owned by nagios:nagios
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 1:34 pm

what does this show on the remote host:

Code: Select all

# cat /etc/nagios/nrpe.cfg | grep "^command"
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 1:36 pm

richard.scott wrote:what does this show on the remote host:

Code: Select all

# cat /etc/nagios/nrpe.cfg | grep "^command"
# cat /etc/nagios/nrpe.cfg | grep "^command"
command_timeout=60
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_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_home]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /home
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
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 1:40 pm

do you have allowed_hosts= set?
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 1:41 pm

richard.scott wrote:do you have allowed_hosts= set?
Yes and you can see it in the log I pasted

Dec 7 12:58:42 ricbhost nrpe[2867]: Connection from XXX.XXX.XXX.XXX port 47073
Dec 7 12:58:42 ricbhost nrpe[2867]: Host address is in allowed_hosts
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 1:45 pm

why does that log extract from earlier show this:

/usr/nagios/libexec/check_disk

and your nrpe.cfg has this:

/usr/lib/nagios/plugins/check_disk

Rich
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 1:48 pm

richard.scott wrote:why does that log extract from earlier show this:

/usr/nagios/libexec/check_disk

and your nrpe.cfg has this:

/usr/lib/nagios/plugins/check_disk

Rich
I changed that in the nrpe.cfg based on your hint to possible symlink problem...
now it says
Dec 7 14:15:24 ricbhost nrpe[3107]: Host is asking for command 'check_disk' to be run...
Dec 7 14:15:24 ricbhost nrpe[3107]: Running command: /usr/lib/nagios/plugins/check_disk -w 10 -c 5 -p /
Dec 7 14:15:24 ricbhost nrpe[3107]: Command completed with return code 3 and output:
Dec 7 14:15:24 ricbhost nrpe[3107]: Return Code: 3, Output: NRPE: Unable to read output
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 1:53 pm

try this in nrpe.cfg

Code: Select all

-p "$ARG3$"
I think the "" marks helped me?
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 1:56 pm

richard.scott wrote:try this in nrpe.cfg

Code: Select all

-p "$ARG3$"
I think the "" marks helped me?
Thanks, good hint, however did not help
Dec 7 14:56:00 ricbhost nrpe[3209]: Host is asking for command 'check_disk' to be run...
Dec 7 14:56:00 ricbhost nrpe[3209]: Running command: /usr/lib/nagios/plugins/check_disk -w 10 -c 5 -p "/"
Dec 7 14:56:00 ricbhost nrpe[3209]: Command completed with return code 3 and output:
Dec 7 14:56:00 ricbhost nrpe[3209]: Return Code: 3, Output: NRPE: Unable to read output
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 2:03 pm

ok, what about this:

Code: Select all

ssh remote_ip /usr/lib/nagios/plugins/check_disk -w 10 -c 5 -p "/"
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 2:08 pm

richard.scott wrote:ok, what about this:

Code: Select all

ssh remote_ip /usr/lib/nagios/plugins/check_disk -w 10 -c 5 -p "/"
# ssh remote_ip /usr/lib/nagios/plugins/check_disk -w 10 -c 5 -p "/"
DISK OK - free space: / 33309 MB (55% inode=-);| /=26696MB;59996;60001;0;60006
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 2:26 pm

try and add " 2>&1" to the end of your command definition in nrpe.cfg.
This will echo back stderr, which may tell you what's wrong.
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Mon Dec 07, 2009 2:35 pm

richard.scott wrote:try and add " 2>&1" to the end of your command definition in nrpe.cfg.
This will echo back stderr, which may tell you what's wrong.
Now THAT was a good hint.... as I though, permissions problem on the folder
/var/lib/nagios

It is fixed now...

Thank you again for your support :)
Top
richard.scott
Veteran
Veteran
Posts: 1497
Joined: Mon May 19, 2003 5:19 pm
Location: Oxfordshire, UK
Contact:
Contact richard.scott
Website

  • Quote

Post by richard.scott » Mon Dec 07, 2009 2:42 pm

kolcon wrote:Thank you again for your support :)
No prob, glad its working :-)
Top
Post Reply

24 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy