Bug 34063

Summary: nagios-nrpe-server doesn't create a pid file
Product: UCS Reporter: Ulf Friedel <uf>
Component: Monitoring (Prometheus or Nagios)Assignee: Felix Botner <botner>
Status: CLOSED FIXED QA Contact: Philipp Hahn <hahn>
Severity: normal    
Priority: P5 CC: gohmann, jmm
Version: UCS 3.2   
Target Milestone: UCS 3.2-1-errata   
Hardware: amd64   
OS: Linux   
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:

Description Ulf Friedel 2014-02-06 09:14:38 CET
UCS 3.2 Errata 45
nagios-nrpe-server version 2.12-4.12.201104270034


Due to missing permissions, the nagios user cannot create it's pid file in /var/run.

# cat /var/log/syslog | grep nrpe.pid
Jan 24 13:14:10 master nrpe[23500]: Cannot write to pidfile '/var/run/nrpe.pid' - check your privileges.


According to the change log of nagios-nrpe-server the handling of pid files in version 2.12-4 was changed:

* Fix pidfile handling (Closes: #411046)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411046


See the configuration file /etc/nagios/nrpe.cfg.debian for details:

# PID FILE
# The name of the file in which the NRPE daemon should write it's process ID
# number.  The file is only written if the NRPE daemon is started by the root
# user and is running in standalone mode.

pid_file=/var/run/nagios/nrpe.pid


This was not included in the current Univention-Template as expexted:

/etc/univention/templates/files/etc/nagios/nrpe.cfg

# PID FILE
# The name of the file in which the NRPE daemon should write it's process ID
# number.  The file is only written if the NRPE daemon is started by the root
# user and is running in standalone mode.

pid_file=/var/run/nrpe.pid


This is important, since the nagios-nrpe-server (version 2.12-5) start-stop-daemon uses the pid file.

* [e776f7b] Use pidfile for start-stop-daemon and fix pidfile deletion (Closes: #548157, #639523)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639523


I feel /etc/univention/templates/files/etc/nagios/nrpe.cfg needs to be changed accordingly.
Comment 1 Felix Botner univentionstaff 2014-03-17 14:45:42 CET
In univention-nagios-client:

 * Changed pid_file to /var/run/nagios/nrpe.pid in
   /etc/univention/templates/files/etc/nagios/nrpe.cfg

 * Create and "chown nagios" PIDDIR=/var/run/nagios in
   /etc/univention/templates/files/etc/init.d/nagios-nrpe-server:

YAML: 2014-03-17-univention-nagios.yaml
Comment 2 Philipp Hahn univentionstaff 2014-04-03 13:28:41 CEST
OK: r48584,r48571
OK: grep nrpe.pid /var/log/syslog
OK: aptitude install '?source-package(univention-nagios)?installed'
OK: ps $(</var/run/nagios/nrpe.pid)
OK: ~/bin/announce_errata -V 2014-03-17-univention-nagios.yaml
FIXED: r48586,r49020 2014-03-17-univention-nagios.yaml
Comment 3 Moritz Muehlenhoff univentionstaff 2014-04-30 08:49:34 CEST
http://errata.univention.de/ucs/3.2/101.html