Why installed nagios plugins doesnt work?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Why installed nagios plugins doesnt work?

Post 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!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Why installed nagios plugins doesnt work?

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Why installed nagios plugins doesnt work?

Post 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)
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Why installed nagios plugins doesnt work?

Post by Jessuzz94 »

Well.. i installed nagios like all tutorials, download the nagios-4.0.8, ./configure, make all, make install, make install-init.. etc
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Why installed nagios plugins doesnt work?

Post 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.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Why installed nagios plugins doesnt work?

Post by Jessuzz94 »

This is a more completely install of nagios?, i see that is little different that my installation
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Why installed nagios plugins doesnt work?

Post 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.
Former Nagios Employee.
me.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Why installed nagios plugins doesnt work?

Post by Jessuzz94 »

Ok, im starting doing the steps
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Why installed nagios plugins doesnt work?

Post by jolson »

Sounds good - let us know how it works out.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: Why installed nagios plugins doesnt work?

Post 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
Locked