RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1478895 - Tang should support the Nagios engine for event recording
Summary: Tang should support the Nagios engine for event recording
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tang
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Nathaniel McCallum
QA Contact: Jiri Jaburek
Mirek Jahoda
URL:
Whiteboard:
Depends On:
Blocks: 1490328
TreeView+ depends on / blocked
 
Reported: 2017-08-07 13:00 UTC by Dmitri Pal
Modified: 2018-03-01 14:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
_tang-nagios_ enables *Nagios* to monitor *Tang* The _tang-nagios_ subpackage provides the *Nagios* plugin for *Tang*. The plugin enables the *Nagios* program to monitor a *Tang* server. The subpackage is available in the Optional channel. See the `tang-nagios(1)` man page for more information.
Clone Of:
: 1490328 (view as bug list)
Environment:
Last Closed: 2018-03-01 14:06:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dmitri Pal 2017-08-07 13:00:44 UTC
Tang should support the Nagios engine for event recording.
This functionality (tang-nagious) is available upstream (and Fedora) and needs to be productized.
https://www.mankier.com/1/tang-nagios

Comment 1 Nathaniel McCallum 2017-08-17 14:00:08 UTC
Testing instructions:

$ dnf -y install tang tang-nagios
...
$ systemctl start tangd.socket
...
$ /usr/lib64/nagios/plugins/tang -u http://localhost
OK|adv=27611 exc=46064 nkeys=2 nsigk=1 nexck=1
$ echo $?
0

This should output data according to this API: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html

The specific data points we return are defined in the tang-nagios man page.

You can also test for the failure case:
$ sudo systemctl stop tangd.socket
...
$ /usr/lib64/nagios/plugins/tang -u http://localhost
Unable to connect to server!
$ echo $?
2

Full testing would involve actually setting up a nagios instance and attempting to use the plugin. I have not done this, but others have.

Comment 2 Jiri Jaburek 2017-08-18 10:51:06 UTC
Note that all other nagios plugins (RPMS) in EPEL and the non-tang one in RHEL are named like "nagios-plugins-$name", not "$name-nagios".

Comment 3 Jiri Jaburek 2017-08-18 11:43:31 UTC
Some more detailed notes how to properly test this:

 1) install nagios and ie. nagios-plugins-all RPMs from EPEL
 2) set selinux to permissive (or write policy module for nagios)
 3) enable and start httpd and nagios services
 4) htpasswd -c /etc/nagios/passwd nagiosadmin;  enter some password
 5) login via web browser on http://hostname/nagios, you should see "Daemon running with PID ..."
 6) install tang and tang-nagios
 7) edit /usr/lib/systemd/system/tangd.socket, change port to ie. 81
 8) rm -rf /var/db/tang/* /var/cache/tang/*
 9) /usr/libexec/tangd-keygen /var/db/tang
10) /usr/libexec/tangd-update /var/db/tang /var/cache/tang
11) /usr/lib64/nagios/plugins/tang -u http://localhost:81;  should return OK
12) edit /etc/nagios/objects/commands.cfg, add 'define command', see below
13) edit /etc/nagios/objects/localhost.cfg, add 'define service', see below
14) restart the nagios service
15) refresh nagios web ui, see Tang in localhost services list
16) wait a few minutes for PENDING to become OK

define command{
        command_name    check_tang
        command_line    /usr/lib64/nagios/plugins/tang -u $ARG1$
}

define service{
        use                             local-service
        host_name                       localhost
        service_description             Tang
        check_command                   check_tang!http://localhost:81
        notifications_enabled           0
        }


From there on, testing other cases (missing keys, tangd not enabled, etc.) is possible.

Comment 4 Nathaniel McCallum 2017-08-18 12:47:06 UTC
(In reply to Jiri Jaburek from comment #2)
> Note that all other nagios plugins (RPMS) in EPEL and the non-tang one in
> RHEL are named like "nagios-plugins-$name", not "$name-nagios".

I'm aware of this. When I last checked, all of the "nagios-plugins-$name" packages were subpackages of nagios. We can rename the package if we think it is important. Let me know what your opinion is.

Comment 5 Jiri Jaburek 2017-08-21 10:27:51 UTC
(In reply to Nathaniel McCallum from comment #4)
> (In reply to Jiri Jaburek from comment #2)
> > Note that all other nagios plugins (RPMS) in EPEL and the non-tang one in
> > RHEL are named like "nagios-plugins-$name", not "$name-nagios".
> 
> I'm aware of this. When I last checked, all of the "nagios-plugins-$name"
> packages were subpackages of nagios. We can rename the package if we think
> it is important. Let me know what your opinion is.

Since we already have one other nagios plugin in RHEL (optional channel):

Name        : nagios-plugins-bacula
Arch        : x86_64
Version     : 5.2.13
Release     : 23.1.el7
Size        : 26 k
Repo        : rhel-ks-opt
Summary     : Nagios Plugin - check_bacula
URL         : http://www.bacula.org
License     : AGPLv3 with exceptions
Description : Provides check_bacula support for Nagios.

I'd suggest we follow the naming scheme.


Note You need to log in before you can comment on or make changes to this bug.