[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2669
  • Last Modified:

nagios is not starting after "yum update"

I perform yum update on my CentOs system. After the update nagios process cannot be started. Error message in the log is the following:

[09-11-2012 11:28:04] Bailing out due to errors encountered while initializing the embedded Perl interpreter. (PID=10462)
Informational Message[09-11-2012 11:28:04] Error: p1.pl file required for embedded Perl interpreter is missing!

Could you help me in solving this problem
0
dedri
Asked:
dedri
  • 6
  • 4
  • 3
7 Solutions
 
Kerem ERSOYPresidentCommented:
Hi,

Using embeded perl is not advisable in most situations. Just edit your nagios config file and add this:

enable_embedded_perl=0

Open in new window


save & exit and then issue this command:
service httpd restart

Open in new window


Cheers,
K.
0
 
Kerem ERSOYPresidentCommented:
Just edit your nagis.cfg and see where is perl located it should be something like:

# P1.PL FILE LOCATION
# This value determines where the p1.pl perl script (used by the
# embedded Perl interpreter) is located.  If you didn't compile
# Nagios with embedded Perl support, this option has no effect.

p1_file=/usr/lib/nagios/p1.pl

Open in new window


and just see it the file is there. If it is already there then you might have SELinux intervening. In this case just post the ouptupt of

sestatus

command here.

Cheers,
K.
0
 
dedriAuthor Commented:
I've changed the enable_embedded_perl=0 in nagios configuration file
Then I executed the following command :                                            

[root@hqnagios ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@hqnagios ~]# service nagios start
nagios is stopped
Starting nagios:                                           [FAILED]

In the log file error message is the same:
Error: p1.pl file required for embedded Perl interpreter is missing!
nagiosconfigurationfile.txt
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Kerem ERSOYPresidentCommented:
It seems that it is still looking for the file so probably it is not the config file it loads during startup. I guess it should be in /etc/nagios.

When it comes to SELinux:

post the output of sestatus here. Also the output from

ls -alZ /usr/lib/nagios

Open in new window

 (the location of p1.pl)

Cheers,
K.
0
 
dedriAuthor Commented:
[root@hqnagios ~]# sestatus
SELinux status:                 disabled
[root@hqnagios ~]# ls -alZ /usr/lib/nagios
drwxr-xr-x  root root                                  .
drwxr-xr-x  root root system_u:object_r:lib_t:s0       ..
drwxr-xr-x  root root                                  cgi
drwxr-xr-x  root root                                  plugins
[root@hqnagios ~]#
0
 
dedriAuthor Commented:
According to the naigos configuration file   -->  p1_file=/usr/sbin/p1.pl
But there is no such file in /usr/sbin/
Attached is a excerpt from /var/log/messages which shows which packets have been updated.
messages.txt
0
 
jhheiderCommented:
Locate you're p1.pl file:

find /usr | grep p1.pl

(since find | grep is usually faster than find -name)

Edit your nagios.cfg to reflect that location.

nagios -v /path/to/nagios.cfg

If there are no errors, /etc/init.d/nagios restart
0
 
dedriAuthor Commented:
I am still having the problem

[root@hqnagios ~]# find /usr | grep p1.pl
/usr/bin/p1.pl
/usr/include/nss3/p12plcy.h

I updated the nagios.cfg file with
p1_file=/usr/bin/p1.pl
enable_embedded_perl=0
use_embedded_perl_implicitly=1

[root@hqnagios ~]# nagios -v /etc/nagios/nagios.cfg

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/etc/nagiosql/contacttemplates.cfg'...
Processing object config file '/etc/nagiosql/contactgroups.cfg'...
Processing object config file '/etc/nagiosql/contacts.cfg'...
Processing object config file '/etc/nagiosql/timeperiods.cfg'...
Processing object config file '/etc/nagiosql/commands.cfg'...
Processing object config file '/etc/nagiosql/hostgroups.cfg'...
Processing object config file '/etc/nagiosql/servicegroups.cfg'...
Processing object config directory '/etc/nagiosql/hosts'...
Processing object config file '/etc/nagiosql/hosts/HQSUCAUTH.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqdb3.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqdc1.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-varna.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqhelpdesk.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqdb3sb.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqdku.cfg'...
Processing object config file '/etc/nagiosql/hosts/esx2.cfg'...
Processing object config file '/etc/nagiosql/hosts/tstcft.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqfs1.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqts1.cfg'...
Processing object config file '/etc/nagiosql/hosts/HQOMEGA.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqCSM.cfg'...
Processing object config file '/etc/nagiosql/hosts/HQWSUS.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqloansapps.cfg'...
Processing object config file '/etc/nagiosql/hosts/esx3.cfg'...
Processing object config file '/etc/nagiosql/hosts/N6040tsumB.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqatlweb.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-sandanski.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqrep1.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-blagoevgradVPN.cfg'...
Processing object config file '/etc/nagiosql/hosts/dresxi1.cfg'...
Processing object config file '/etc/nagiosql/hosts/esx4.cfg'...
Processing object config file '/etc/nagiosql/hosts/hibapp.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqtsum.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqtsum-ilo2.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqrepsrv1.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqts6.cfg'...
Processing object config file '/etc/nagiosql/hosts/esxi5.cfg'...
Processing object config file '/etc/nagiosql/hosts/ciscolms.cfg'...
Processing object config file '/etc/nagiosql/hosts/hibadmin.cfg'...
Processing object config file '/etc/nagiosql/hosts/esx1.cfg'...
Processing object config file '/etc/nagiosql/hosts/INTRANET.cfg'...
Processing object config file '/etc/nagiosql/hosts/N6040lkA.cfg'...
Processing object config file '/etc/nagiosql/hosts/emphqdb1.cfg'...
Processing object config file '/etc/nagiosql/hosts/esxi6.cfg'...
Processing object config file '/etc/nagiosql/hosts/bladeCenterLK.cfg'...
Processing object config file '/etc/nagiosql/hosts/bladeCenterTsum.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqts5.cfg'...
Processing object config file '/etc/nagiosql/hosts/hibdb1.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqrepdb.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-bulgariaVPN.cfg'...
Processing object config file '/etc/nagiosql/hosts/dresxi4.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqrep2.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqts3.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqcftsrv.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-plovdiv.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqnagios.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqexc2.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqatlapp.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqts2.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-plovdivVPN.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-bulgaria.cfg'...
Processing object config file '/etc/nagiosql/hosts/DRTSM1.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-blagoevgrad.cfg'...
Processing object config file '/etc/nagiosql/hosts/lkvcenter.cfg'...
Processing object config file '/etc/nagiosql/hosts/N6040tsumA.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqnbt.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqts4.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqsucapp.cfg'...
Processing object config file '/etc/nagiosql/hosts/HQTSMVM.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqmqsrv.cfg'...
Processing object config file '/etc/nagiosql/hosts/router-bourgas.cfg'...
Processing object config file '/etc/nagiosql/hosts/N6040lkB.cfg'...
Processing object config file '/etc/nagiosql/hosts/dresxi2.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqpgateapp.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqprintsrv.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqveeam.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqantivir.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqpgateweb.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqexc1.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqanadefi.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqinvest.cfg'...
Processing object config file '/etc/nagiosql/hosts/upslk.cfg'...
Processing object config file '/etc/nagiosql/hosts/expertvision.cfg'...
Processing object config file '/etc/nagiosql/hosts/dresxi3.cfg'...
Processing object config file '/etc/nagiosql/hosts/drvcenter.cfg'...
Processing object config file '/etc/nagiosql/hosts/HQLSDC.cfg'...
Processing object config file '/etc/nagiosql/hosts/hqdb4.cfg'...
Processing object config directory '/etc/nagiosql/services'...
Processing object config file '/etc/nagiosql/services/localhost.cfg'...
Processing object config file '/etc/nagiosql/services/check_ups2.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_tsum_ORAVOL.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenterAT.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenterSwitch.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_tsum_Exch_LUN.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenterBlades.cfg'...
Processing object config file '/etc/nagiosql/services/dhcp.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_lk_VMWAREDS2.cfg'...
Processing object config file '/etc/nagiosql/services/mqwebshere.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenterPower.cfg'...
Processing object config file '/etc/nagiosql/services/expertvisionservices.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_lk_VMWAREDS4.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenter.cfg'...
Processing object config file '/etc/nagiosql/services/NRPE.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_lk_VMWAREDS1.cfg'...
Processing object config file '/etc/nagiosql/services/check_ups1.cfg'...
Processing object config file '/etc/nagiosql/services/check_dns.cfg'...
Processing object config file '/etc/nagiosql/services/check_ilo_health.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_lk_VMWAREDS3.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf.cfg'...
Processing object config file '/etc/nagiosql/services/esx.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenterBlowers.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_tsum_VMWAREDS1.cfg'...
Processing object config file '/etc/nagiosql/services/daisfiledispatcher.cfg'...
Processing object config file '/etc/nagiosql/services/winserver.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_lk_Exch_LUN.cfg'...
Processing object config file '/etc/nagiosql/services/check_tsm_path.cfg'...
Processing object config file '/etc/nagiosql/services/drivef.cfg'...
Processing object config file '/etc/nagiosql/services/winserverSpace20.cfg'...
Processing object config file '/etc/nagiosql/services/cftmain.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_sys_health.cfg'...
Processing object config file '/etc/nagiosql/services/printspooler.cfg'...
Processing object config file '/etc/nagiosql/services/sqlserver.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_tsum_VMWAREDS2.cfg'...
Processing object config file '/etc/nagiosql/services/check_ups.cfg'...
Processing object config file '/etc/nagiosql/services/check_ups3.cfg'...
Processing object config file '/etc/nagiosql/services/vmwareservices.cfg'...
Processing object config file '/etc/nagiosql/services/check_bladecenterSH.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_tsum_VMWAREDS3.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_lk_ORAVOL.cfg'...
Processing object config file '/etc/nagiosql/services/frsservice.cfg'...
Processing object config file '/etc/nagiosql/services/check_naf_tsum_VMWAREDS4.cfg'...
Processing object config file '/etc/nagiosql/hosttemplates.cfg'...
Processing object config file '/etc/nagiosql/servicetemplates.cfg'...
Processing object config file '/etc/nagiosql/servicedependencies.cfg'...
Processing object config file '/etc/nagiosql/serviceescalations.cfg'...
Processing object config file '/etc/nagiosql/hostdependencies.cfg'...
Processing object config file '/etc/nagiosql/hostescalations.cfg'...
Processing object config file '/etc/nagiosql/hostextinfo.cfg'...
Processing object config file '/etc/nagiosql/serviceextinfo.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 436 services.
Checking hosts...
Warning: Host 'hqrepdb' has no services associated with it!
        Checked 79 hosts.
Checking host groups...
        Checked 15 host groups.
Checking service groups...
        Checked 2 service groups.
Checking contacts...
        Checked 6 contacts.
Checking contact groups...
        Checked 5 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 34 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: 1
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
[root@hqnagios ~]# service nagios start
nagios is stopped
Starting nagios:                                           [FAILED]


#### From /var/log/messages

Sep 11 17:19:31 hqnagios nagios: Failed to obtain lock on file /var/run/nagios.pid: Permission denied
Sep 11 17:19:31 hqnagios nagios: Bailing out due to errors encountered while attempting to daemonize... (PID=6140)
0
 
jhheiderCommented:
Hm.

ls -l /var/run/nagios.pid

?

I'm guessing the permissions got messed up on that somehow. Easiest solution is probably:

/etc/init.d/nagios stop
rm /var/run/nagios.pid
/etc/init.d/nagios start

.
0
 
Kerem ERSOYPresidentCommented:
Sep 11 17:19:31 hqnagios nagios: Failed to obtain lock on file /var/run/nagios.pid: Permission denied
Sep 11 17:19:31 hqnagios nagios: Bailing out due to errors encountered while attempting to daemonize... (PID=6140)

it measn that there's a stale /var/run/nagios.pid please remove it and restart.

Also it seems that you still use the embedded perl:

p1_file=/usr/bin/p1.pl
enable_embedded_perl=0
use_embedded_perl_implicitly=1

Please set both to "0" so that embedded perl never called.
0
 
dedriAuthor Commented:
Here is what I am doing:
Changed also : use_embedded_perl_implicitly=0
After that:


[root@hqnagios ~]# ls -l /var/run/nagios.pid
ls: /var/run/nagios.pid: No such file or directory
[root@hqnagios ~]# rm /var/run/nagios.pid
rm: cannot lstat `/var/run/nagios.pid': No such file or directory
[root@hqnagios ~]# ls -l /var/run/nagios.pid
ls: /var/run/nagios.pid: No such file or directory
[root@hqnagios ~]# /etc/init.d/nagios stop
nagios is stopped
[root@hqnagios ~]# rm /var/run/nagios.pid
rm: cannot lstat `/var/run/nagios.pid': No such file or directory
[root@hqnagios ~]# /etc/init.d/nagios start
nagios is stopped
Starting nagios:                                           [FAILED]


##### And the message from the log is :

Sep 12 08:33:08 hqnagios nagios: Failed to obtain lock on file /var/run/nagios.pid: Permission denied
Sep 12 08:33:08 hqnagios nagios: Bailing out due to errors encountered while attempting to daemonize... (PID=25751)

Any help please
0
 
jhheiderCommented:
ls -ld /var/run/nagios

Open in new window


It's sounding like it can't write the PID file. Another useful test might be to run:

bash -x /etc/init.d/nagios start

Open in new window


so you can see exactly what it's trying to do.
0
 
dedriAuthor Commented:
I changed this line:

   lock_file=/var/run/nagios.pid

to this:

   lock_file=/var/nagios/nagios.pid

in the configuration file and nagios has been started successful.

10x to everyone for your help
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 6
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now