Red Hat Bugzilla – Bug 1425724
Move custom nrpe commands to conf.d folder
Last modified: 2017-09-21 00:53:44 EDT
Description of problem: With the rise of configuration management tools, the default nrpe.conf file often times gets overwritten. A simple solution for this is to move our custom nrpe commands in a special configuration file in /etc/nrpe.d/ Version-Release number of selected component (if applicable): RHGS 3.1.3 (version independent) gluster-nagios-addons-0.2.7-1.el7 gluster-nagios-common-0.2.4-1.el7 How reproducible: always Steps to Reproduce: 1. Have a configuration management tool that templates the nrpe.conf file 2. See the custom gluster commands disappear Actual results: Customer Gluster commands are inaccessible breaking monitoring Expected results: Gluster commands are still reachable Additional info: Please :)
Patch https://review.gluster.org/#/c/17306 posted to address this. Moved the gluster nrpe commands to /etc/nrpe.d/glusternrpe.cfg
Verified this bz with gluster-nagios-addons-0.2.9-1.el7rhgs.x86_64 and glusterfs-3.8.4-26.el7rhgs.x86_64. The section related to gluster in /etc/nagios/nrpe.cfg is moved to /etc/nrpe.d/glusternrpe.cfg. There is no impact on the configured nagios functionality, when tried with fresh install or upgrade. Moving the BZ to verified in 3.3. Related logs are pasted below: [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# gluster pool list UUID Hostname State afa697a0-2cc6-4705-892e-f5ec56a9f9de dhcp47-164.lab.eng.blr.redhat.com Connected 95491d39-d83a-4053-b1d5-682ca7290bd2 dhcp47-162.lab.eng.blr.redhat.com Connected d0955c85-94d0-41ba-aea8-1ffde3575ea5 dhcp47-157.lab.eng.blr.redhat.com Connected 834d66eb-fb65-4ea3-949a-e7cb4c198f2b localhost Connected [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# gluster v list distrep ozone [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# rpm -qa | grep gluster glusterfs-3.8.4-26.el7rhgs.x86_64 glusterfs-api-3.8.4-26.el7rhgs.x86_64 gluster-nagios-addons-0.2.9-1.el7rhgs.x86_64 glusterfs-cli-3.8.4-26.el7rhgs.x86_64 samba-vfs-glusterfs-4.6.3-1.el7rhgs.x86_64 glusterfs-server-3.8.4-26.el7rhgs.x86_64 python-gluster-3.8.4-26.el7rhgs.noarch vdsm-gluster-4.17.33-1.1.el7rhgs.noarch gluster-nagios-common-0.2.4-1.el7rhgs.noarch glusterfs-libs-3.8.4-26.el7rhgs.x86_64 glusterfs-client-xlators-3.8.4-26.el7rhgs.x86_64 glusterfs-geo-replication-3.8.4-26.el7rhgs.x86_64 glusterfs-events-3.8.4-26.el7rhgs.x86_64 glusterfs-rdma-3.8.4-26.el7rhgs.x86_64 libvirt-daemon-driver-storage-gluster-3.2.0-4.el7.x86_64 glusterfs-fuse-3.8.4-26.el7rhgs.x86_64 [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# rpm -qa | grep nagios nagios-plugins-ide_smart-1.4.16-12.el7rhgs.x86_64 nagios-plugins-ping-1.4.16-12.el7rhgs.x86_64 gluster-nagios-addons-0.2.9-1.el7rhgs.x86_64 nagios-server-addons-0.2.6-1.el7rhgs.x86_64 nagios-3.5.1-9.el7.x86_64 pnp4nagios-0.6.22-3.1.el7rhgs.x86_64 gluster-nagios-common-0.2.4-1.el7rhgs.noarch nagios-plugins-procs-1.4.16-12.el7rhgs.x86_64 nagios-common-3.5.1-9.el7.x86_64 nagios-plugins-nrpe-2.15-4.2.el7rhgs.x86_64 nagios-plugins-1.4.16-12.el7rhgs.x86_64 nagios-plugins-dummy-1.4.16-12.el7rhgs.x86_64 [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# nagios -v /etc/nagios/nagios.cfg Nagios Core 3.5.1 Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors Copyright (c) 1999-2009 Ethan Galstad Last Modified: 08-30-2013 License: GPL Website: http://www.nagios.org Reading configuration data... Read main config file okay... Processing object config file '/etc/nagios/objects/commands.cfg'... Processing object config file '/etc/nagios/objects/contacts.cfg'... ... ... ... Checking obsessive compulsive processor commands... Checking misc settings... Total Warnings: 25 Total Errors: 0 Things look okay - No serious problems were detected during the pre-flight check [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# grep "gluster" /etc/nagios/nrpe.cfg [root@dhcp47-165 ~]# [root@dhcp47-165 ~]# ll /etc/nrpe.d/glusternrpe.cfg -rw-r--r--. 1 root root 1657 May 18 10:42 /etc/nrpe.d/glusternrpe.cfg [root@dhcp47-165 ~]# cat /etc/nrpe.d/glusternrpe.cfg command[check_disk_and_inode]=sudo /usr/lib64/nagios/plugins/gluster/check_mounts.py -w 80 -c 90 -i / -i /boot -i /home -i /var -i /usr command[check_memory]=/usr/lib64/nagios/plugins/gluster/memory.py -w 80 -c 90 -t 2 command[check_swap_usage]=/usr/lib64/nagios/plugins/gluster/swap.py -w 80 -c 90 -t 2 command[check_cpu_multicore]=/usr/lib64/nagios/plugins/gluster/cpu.py -w 80 -c 90 -t 2 command[check_interfaces]=/usr/lib64/nagios/plugins/gluster/network.py -e lo -e ';vdsmdummy;' -t 2 command[check_brick_usage]=sudo /usr/lib64/nagios/plugins/gluster/check_mounts.py -w 80 -c 90 -i \$ARG1\$ command[check_vol_utilization]=sudo /usr/lib64/nagios/plugins/gluster/check_vol_utilization.py \$ARG1\$ -w \$ARG2\$ -c \$ARG3\$ command[check_vol_status]=sudo /usr/lib64/nagios/plugins/gluster/check_volume_status.py -v \$ARG1\$ -t \$ARG2\$ command[check_proc_status]=sudo /usr/lib64/nagios/plugins/gluster/check_gluster_proc_status.py -t \$ARG1\$ command[check_brick_status]=sudo /usr/lib64/nagios/plugins/gluster/check_gluster_proc_status.py -t BRICK -v \$ARG1\$ -b \$ARG2\$ command[discoverpeers]=sudo /usr/lib64/nagios/plugins/gluster/discoverpeers.py command[discover_volume_list]=sudo /usr/lib64/nagios/plugins/gluster/discover_volumes.py -l command[discover_volume_info]=sudo /usr/lib64/nagios/plugins/gluster/discover_volumes.py -v \$ARG1\$ command[discoverhostparams]=sudo /usr/lib64/nagios/plugins/gluster/discoverhostparams.py command[configure_gluster_node]=sudo /usr/lib64/nagios/plugins/gluster/configure_gluster_node.py -c \$ARG1\$ -n \$ARG2\$ -H \$ARG3\$ command[check_quorum_status]=sudo /usr/lib64/nagios/plugins/gluster/check_quorum_status.py [root@dhcp47-165 ~]#
Minor changes in Doc Text based on Peer Review.
Doc text changed: NERP -> NRPE
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2781