issues relating to nagios and lack of nrpe on nagios unit

Bug #1890460 reported by Jeff Hillman
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Nagios Charm
Won't Fix
Medium
Unassigned
Rsyslog Forwarder HA Charm
Won't Fix
Medium
Unassigned

Bug Description

Stable charms
Bionic

When relating rsyslog-forwarder-ha to the nagios unit, an error appears:

---

2020-08-05 13:23:57 ERROR juju.worker.uniter.operation runhook.go:132 hook "config-changed" failed: exit status 1
2020-08-05 13:25:19 DEBUG config-changed Traceback (most recent call last):
2020-08-05 13:25:19 DEBUG config-changed File "/var/lib/juju/agents/unit-rsyslog-forwarder-ha-1/charm/hooks/config-changed", line 294, in <module>
2020-08-05 13:25:19 DEBUG config-changed hooks.execute(sys.argv)
2020-08-05 13:25:19 DEBUG config-changed File "/var/lib/juju/agents/unit-rsyslog-forwarder-ha-1/charm/hooks/charmhelpers/core/hookenv.py", line 909, in execute
2020-08-05 13:25:19 DEBUG config-changed self._hooks[hook_name]()
2020-08-05 13:25:19 DEBUG config-changed File "/var/lib/juju/agents/unit-rsyslog-forwarder-ha-1/charm/hooks/config-changed", line 287, in config_changed
2020-08-05 13:25:19 DEBUG config-changed update_nrpe_config()
2020-08-05 13:25:19 DEBUG config-changed File "/var/lib/juju/agents/unit-rsyslog-forwarder-ha-1/charm/hooks/config-changed", line 123, in update_nrpe_config
2020-08-05 13:25:19 DEBUG config-changed nrpe_compat.write()
2020-08-05 13:25:19 DEBUG config-changed File "/var/lib/juju/agents/unit-rsyslog-forwarder-ha-1/charm/hooks/charmhelpers/contrib/charmsupport/nrpe.py", line 301, in write
2020-08-05 13:25:19 DEBUG config-changed self.nagios_servicegroups)
2020-08-05 13:25:19 DEBUG config-changed File "/var/lib/juju/agents/unit-rsyslog-forwarder-ha-1/charm/hooks/charmhelpers/contrib/charmsupport/nrpe.py", line 195, in write
2020-08-05 13:25:19 DEBUG config-changed with open(nrpe_check_file, 'w') as nrpe_check_config:
2020-08-05 13:25:19 DEBUG config-changed IOError: [Errno 2] No such file or directory: '/etc/nagios/nrpe.d/check_rsyslog.cfg'

---

It appears the r-f-ha is expecting nrpe to be here. from the code:

---
@hooks.hook("nrpe-external-master-relation-changed")
@hooks.hook("local-monitors-relation-changed")
def update_nrpe_config():
    nrpe_compat = nrpe.NRPE()
    nrpe_compat.add_check(
        shortname="rsyslog",
        description="Check rsyslog is running",
        check_cmd="check_procs -c 1: -C rsyslogd"
    )
    nrpe_compat.write()

---

This works on all other units since we have nrpe-{host|container} there, but it is redundant and not sensible to have nrpe on a nagios unit.

running 'mkdir -p /etc/nagios/nrpe.d' on the nagios unit where r-f-ha is at resolves the issue.

Tags: cpe-onsite
Revision history for this message
Adam Dyess (addyess) wrote :

Yeah, seems like there's definitely an issue here.

Changed in charm-rsyslog-forwarder-ha:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Drew Freiberger (afreiberger) wrote :

I've seen this as well. This means that rsyslog service is not monitored on nagios units where nagios monitors itself (instead of using nrpe subordinate plugin).

This could be an issue for any subordinate charms that try to add_check. I'm going to subscribe the Nagios charm as I believe nagios should add this directory and include those checks in it's configuration somehow if it's set to monitor self.

Changed in charm-rsyslog-forwarder-ha:
status: Triaged → Confirmed
Changed in charm-nagios:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Eric Chen (eric-chen) wrote :

This charm is no longer being actively maintained. Please consider using the new Canonical Observability Stack instead.
(https://charmhub.io/topics/canonical-observability-stack)
I will close this issue

Changed in charm-nagios:
status: Confirmed → Won't Fix
Changed in charm-rsyslog-forwarder-ha:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.