Bug 845243 - [RFE] cluster-snmp: make unmet requirements for proper function (e.g., modclusterd not running) more explicit
[RFE] cluster-snmp: make unmet requirements for proper function (e.g., modclu...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: clustermon (Show other bugs)
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Jan Pokorný
: FutureFeature, Reopened
Depends On:
  Show dependency treegraph
Reported: 2012-08-02 08:47 EDT by Vadim Grinco
Modified: 2016-08-24 17:18 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-08-24 17:18:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Vadim Grinco 2012-08-02 08:47:52 EDT
Description of problem:
I can't use libClusterMonitorSnmp.so module. Here's what snmpd reports when started with -H flag:
duplicate registration (rhcMIBVersion, rhcMIBVersion)duplicate registration (rhcClusterFailedServicesNum, rhcClusterFailedServicesNum)duplicate registration (rhcClusterFailedServicesNames, rhcClusterFailedServicesNames)duplicate registration (rhcClusterStatusDesc, rhcClusterStatusDesc)duplicate registration (rhcClusterVotes, rhcClusterVotes)duplicate registration (rhcClusterQuorate, rhcClusterQuorate)duplicate registration (rhcClusterStoppedServicesNum, rhcClusterStoppedServicesNum)duplicate registration (rhcClusterStoppedServicesNames, rhcClusterStoppedServicesNames)duplicate registration (rhcClusterAvailNodesNum, rhcClusterAvailNodesNum)duplicate registration (rhcClusterAvailNodesNames, rhcClusterAvailNodesNames)duplicate registration (rhcClusterServicesNum, rhcClusterServicesNum)duplicate registration (rhcClusterServicesNames, rhcClusterServicesNames)duplicate registration (rhcClusterName, rhcClusterName)duplicate registration (rhcClusterConfigVersion, rhcClusterConfigVersion)duplicate registration (rhcClusterStatusCode, rhcClusterStatusCode)duplicate registration (rhcClusterUnavailNodesNum, rhcClusterUnavailNodesNum)duplicate registration (rhcClusterUnavailNodesNames, rhcClusterUnavailNodesNames)duplicate registration (rhcClusterNodesNum, rhcClusterNodesNum)duplicate registration (rhcClusterNodesNames, rhcClusterNodesNames)duplicate registration (rhcClusterRunningServicesNum, rhcClusterRunningServicesNum)duplicate registration (rhcClusterRunningServicesNames, rhcClusterRunningServicesNames)duplicate registration (rhcClusterVotesNeededForQuorum, rhcClusterVotesNeededForQuorum)duplicate registration (rhcNodesTable, rhcNodesTable)duplicate registration (rhcServicesTable, rhcServicesTable)

Version-Release number of selected component (if applicable):

How reproducible:
Always, tried on many hosts.

Steps to Reproduce:
1. yum install cluster-snmp on a working cluster
2. add "dlmod RedHatCluster	/usr/lib64/cluster-snmp/libClusterMonitorSnmp.so" to the top of snmpd.conf
3. snmpd -f -c /etc/snmp/snmpd.conf -H
Actual results:
# snmpwalk -v 2c -c engsys localhost
SNMPv2-SMI::enterprises.2312. = INTEGER: 2

Expected results:
Be able to monitor all cluster components.

Additional info:
cluster.conf available on demand.
Comment 1 Jan Pokorný 2012-08-02 09:54:58 EDT
Admittedly, "Red Hat Cluster Suite" product in Bugzilla is tempting,
but no longer in use (no longer having a standalone position).

As per the packages, flipping to RHEL 6 -- clustermon.

Purely preemptively, could you attach that cluster.conf?
Comment 6 Jan Pokorný 2012-08-13 10:11:11 EDT

the issue you encountered is caused by the way the snmpd
handles configuration files -- it does *not* try to eliminate
duplicate configuration files found along its initialization.

Use can use "-DALL" to find that in "snmpd -f -c /etc/snmp/snmpd.conf -H"
case, you actually let snmpd proceed that config file twice:

1. first using built-in configuration paths
   (/etc/snmp, /usr/share/snmp, /usr/lib64/snmp, ...)

2. reading optional config file (via "-c"): "/etc/snmp/snmpd.conf"

That is were the duplicity arises.

As per snmpd(8), what you need here is "-C" option:

> Do not read any configuration files except the ones optionally
> specified by the -c option.

Voila, "snmpd -f -C -c /etc/snmp/snmpd.conf -H" works correctly (for me).
Indeed, you can simply get rid of "-c /etc/snmp/snmpd.conf" as it
is read implicitly.

Closing as NOTABUG.
You may want to open a bug with net-snmp to prevent reusing the same
configuration file, but I don't think it can be clearly qualified
as a bug.
Comment 7 Vadim Grinco 2012-08-13 10:14:39 EDT
Jan, you're right about the -C option, and I am sorry for confustion, however, although the config file is parsed correctly and everything seems fine, try
`snmpwalk -v 2c -c engsys localhost'

You won't get any details about the cluster other than:
SNMPv2-SMI::enterprises.2312. = INTEGER: 2
Comment 8 Jan Pokorný 2012-08-14 15:33:35 EDT
Ah, I see, you expected the whole tree of cluster-related values.

At first, make sure you have (in addition to mentioned dlmod directive)
also this line in /etc/snmp/snmpd.conf (or whatever config you use):

        view    systemview    included   REDHAT-CLUSTER-MIB::redhatCluster

When cluster-snmp package installed, you can also refer to
/usr/share/doc/cluster-snmp-*/README.snmp file (please note
the case-sensitivity;  correct casing in RHEL 6 (with the exception
of dlmod directive, is "redhatCluster" [*]).

The second thing to check (in case of enforcing SELinux), is a right
context of /etc/cluster/cluster.conf, as otherwise modclusterd
(backing cluster-snmp) is in trouble.  If the context does not look
like "unconfined_u:object_r:cluster_conf_t:s", apply restorecon.
Similarly, accepting input rule for TCP port 16851 is needed
(amongst other ports needed for proper function of the cluster)
if you have firewall enabled on the cluster nodes.

You can check that everything is OK in the backend by:

# echo \
  '<request API_version="1.0"><function_call name="status"/></request>' \
  | /usr/libexec/modcluster

This should return XML chunk containing

        <var mutable="false" name="success" type="boolean" value="true"/>

Now, everything should work, e.g.:

$ snmpwalk -v 2c -c public rhel63-64kvm-2
SNMPv2-SMI::enterprises.2312. = INTEGER: 2
SNMPv2-SMI::enterprises.2312. = STRING: "rhel63-64kvm"
SNMPv2-SMI::enterprises.2312. = INTEGER: 1
SNMPv2-SMI::enterprises.2312. = STRING:
                                       "All services and nodes functional"

With more convenient representation (first lines apply only to an external

$ mkdir -p ~/.snmp/mibs
$ pushd ~/.snmp/mibs
$ GITBASE="http://git.fedorahosted.org/cgit/conga.git/plain"
$ curl "${GITBASE}/ricci/modules/cluster/clumon/REDHAT{,-CLUSTER}-MIB' -O
$ popd
$ snmpwalk -v 2c -c public rhel63-64kvm-2 REDHAT-CLUSTER-MIB::redhatCluster
REDHAT-CLUSTER-MIB::rhcClusterName.0 = STRING: "rhel63-64kvm"
REDHAT-CLUSTER-MIB::rhcClusterStatusCode.0 = INTEGER: 1
REDHAT-CLUSTER-MIB::rhcClusterStatusDesc.0 = STRING:
                                        "All services and nodes functional"

Please let me know if this bug can be closed.

[*] there is currently one occurence with bad casing, which I fixed
Comment 9 Vadim Grinco 2012-08-15 06:37:57 EDT
Hi Jan,

Seems it was a net-snmp problem. With exactly same version of cluster-snmp and same config file but net-snmp upgraded to net-snmp-5.5-41.el6_3.1.x86_64 it started working just fine.

Thank you.
Comment 10 Vadim Grinco 2012-08-15 06:56:39 EDT
Actually I was wrong, sorry for confustion. Here's what I did:

# snmpwalk -v 2c -c engsys localhost
SNMPv2-SMI::enterprises.2312. = INTEGER: 2
# echo   '<request API_version="1.0"><function_call name="status"/></request>'   | /usr/libexec/modcluster
there was some result

# snmpwalk -v 2c -c engsys localhost
could see all the values

# getenforce 

So it's apparently something with modclusterd or the system set up.
Comment 11 Vadim Grinco 2012-08-15 06:59:07 EDT
Ok, modclusterd was not running, and modcluster started it when I ran it manually. 

So it's definitely not a bug, but should probably be mentioned in the docs:

# grep -i modcluster /usr/share/doc/cluster-snmp-0.16.2/README* | wc -l
Comment 12 Jan Pokorný 2012-08-16 09:27:24 EDT
You are true, running modclusterd is implicitly (and towards user maybe
even secretly) presumed.

Whereas modcluster helper running modclusterd is acceptable from the
higher-level view (triggered indirectly, but in a secured/authorized
fashion), inherently insecure SNMP can be considered as a major blocker
to make the same automagic upon triggering SNMP GET.

Rather, the intended fix (reopening the bug) is:

a. mentioned this fact in README.snmpd as suggested

b. make this obstacle noticable from snmpd logs [*]

[*] currently with stopped modclusterd:

$ snmpwalk -v 2c -c public rhel63-64kvm-2 REDHAT-CLUSTER-MIB::redhatCluster
Error in packet.
Reason: (genError) A general failure occured

# tail -n1 /var/log/messages
Aug 16 15:10:06 rhel63-64kvm-2 snmpd[3795]: cluster-snmp: request cannot be resolved, is modclusterd running?
Comment 14 Jan Pokorný 2014-06-23 11:07:57 EDT
Pushed to 6.7 release consideration.
Comment 17 Jan Pokorný 2016-08-24 17:18:36 EDT
Known issue, can/should be reflected in KCS.

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