Page 1 of 3

Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 11:30 am
by Jessuzz94
Where nagios 4 installed the plugins are in /usr/local/nagios/libexec dont?, i tried to test some services to monitor, for example, check_disk, check_mrtg, check_icmp, check_dhcp... and anyone works, i mean, when i tried to restart nagios to save the new configuration it fails.

When i put the command "systemctl status nagios.service it trhows me:

Code: Select all

Failed to start LSB: Starts and stops the Nagios monitoring server.
Why i cant monitor the services?

Thanks!

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 12:16 pm
by lmiltchev
How did you install nagios - from repo, source? What is the distro/architecture of the system that you installed nagios on? Run the following commands and show the output:

Code: Select all

sestatus
uname -a
cat /etc/*release

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 12:26 pm
by Jessuzz94
sestatus:

Code: Select all

[nagios@localhost ~]$ 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
uname -a

Code: Select all

Linux localhost.localdomain 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/*release

Code: Select all

CentOS Linux release 7.1.1503 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.1.1503 (Core)
CentOS Linux release 7.1.1503 (Core)

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 12:27 pm
by Jessuzz94
Well.. i installed nagios like all tutorials, download the nagios-4.0.8, ./configure, make all, make install, make install-init.. etc

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 1:28 pm
by jolson
Below are some full install instructions verified as working on CentOS 7 - if you're having problems, it may be worth recompiling with the below instructions (I tested them in-house):

Start with a minimal base install or you may run into problems with the below procedure.

Please ensure that SELinux is disabled on the target system:

Code: Select all

sestatus
Install all pre-requisite packages:

Code: Select all

yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp unzip automake
Change to the tmp directory, and download Nagios Core and Nagios Plugins:

Code: Select all

cd /tmp
wget https://github.com/NagiosEnterprises/nagioscore/archive/master.tar.gz -O nagioscore.tar.gz
wget https://github.com/nagios-plugins/nagios-plugins/archive/master.tar.gz -O nagiosplugins.tar.gz
Add the appropriate user and group for the Nagios process (we recommend 'nagios' and 'nagcmd'), and assign nagios+apache to the nagcmd group:

Code: Select all

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
Run the following commands to unpack the Nagios Core and Nagios Plugins source code into tmp:

Code: Select all

tar xzf nagioscore.tar.gz
tar xzf nagiosplugins.tar.gz
cd nagioscore-master
Run the configure command to get the source code ready for compilation:

Code: Select all

./configure --with-command-group=nagcmd
Compile and install:

Code: Select all

make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
Complete the installation:

Code: Select all

cp -R contrib/eventhandlers /usr/local/nagios/libexec
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
Run the Nagios verification command to ensure the install completed properly, and start Nagios:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
Add a default user for web interface access, and start apache (we recommend calling the user 'nagiosadmin'):

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
systemctl start httpd
Change to the Nagios Plugins directory to compile and install the plugins:

Code: Select all

cd /tmp/nagios-plugins-master/
./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Register the Nagios service and Apache to be run upon system startup:

Code: Select all

chkconfig --add nagios
chkconfig --level 35 nagios on
systemctl enable httpd
That should be all that is required. You could check your command history against the commands that I've listed here - or recompile completely if you'd like.

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 1:59 pm
by Jessuzz94
This is a more completely install of nagios?, i see that is little different that my installation

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 2:02 pm
by hsmith
Jessuzz94 wrote:This is a more completely install of nagios?, i see that is little different that my installation
These are the instructions that you'll want to follow.

If you want to post the ones that you followed we can analyze them and see what may have went wrong, but I would just follow what jolson said to do.

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 2:07 pm
by Jessuzz94
Ok, im starting doing the steps

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 2:13 pm
by jolson
Sounds good - let us know how it works out.

Re: Why installed nagios plugins doesnt work?

Posted: Fri Aug 07, 2015 2:30 pm
by Jessuzz94
I did it, it doesnt work, it shows me the same thing:

Error: Could not bind socket to interface eth0. Check your privileges

nagios changed from version 4.0.8 to 4.1.0