[ClusterLabs] ClusterMon SNMP resource agent unable to start
S Sathish S
s.s.sathish at ericsson.com
Thu Nov 24 01:55:29 EST 2022
Hi Team,
we have created ClusterMon resource agent in Clusterlab High Availability , Able to create SNMP resource but unable to start resource further analysis in debug mode it say crm_mon syntax/usage error, Please help us to solve this issue.
Please find the Clusterlab RPM version used:
pacemaker-cluster-libs-2.1.4-1.2.1.4.git.el8.x86_64
resource-agents-4.11.0-1.el8.x86_64
pacemaker-cli-2.1.4-1.2.1.4.git.el8.x86_64
pcs-0.10.14-1.el8.x86_64
corosynclib-3.1.7-1.el8.x86_64
corosync-3.1.7-1.el8.x86_64
pacemaker-2.1.4-1.2.1.4.git.el8.x86_64
pacemaker-libs-2.1.4-1.2.1.4.git.el8.x86_64
pacemaker-schemas-2.1.4-1.2.1.4.git.el8.noarch
Command used to create resource:
pcs resource create SNMP_node1 ClusterMon user='root' extra_options="-E /opt/occ/test/tools/PCSESA.sh"
crm_resource --resource SNMP_node1 --set-parameter priority --meta --parameter-value 10
crm_resource --resource SNMP_node1 --set-parameter failure-timeout --meta --parameter-value 120s
[root at node1 ~]# pcs resource config SNMP_node1
Resource: SNMP_node1 (class=ocf provider=pacemaker type=ClusterMon)
Attributes: SNMP_node1-instance_attributes
extra_options="-E /opt/occ/test/tools/PCSESA.sh"
user=root
Meta Attributes: SNMP_node1-meta_attributes
failure-timeout=120s
priority=10
Operations:
monitor: SNMP_node1-monitor-interval-10s
interval=10s
timeout=20s
start: SNMP_node1-start-interval-0s
interval=0s
timeout=20s
stop: SNMP_node1-stop-interval-0s
interval=0s
timeout=20s
[root at node1 ~]#
Debug Logs:
[root at node1 ~]# pcs resource enable SNMP_node1 --debug
Running: /usr/sbin/cibadmin --local --query
Environment:
LC_ALL=C
Finished running: /usr/sbin/cibadmin --local --query
Return value: 0
--Debug Stdout Start--
<cib crm_feature_set="3.15.0" validate-with="pacemaker-3.8" epoch="171" num_updates="1" admin_epoch="0" cib-last-written="Thu Nov 24 01:10:33 2022" update-origin="node1" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="1">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-have-watchdog" name="have-watchdog" value="false"/>
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.4-1.2.1.4.git.el8-dc6eb4362e6"/>
<nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
<nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="OCC"/>
<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
<nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
<nvpair id="cib-bootstrap-options-startup-fencing" name="startup-fencing" value="false"/>
<nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot"/>
<nvpair id="cib-bootstrap-options-enable-startup-probes" name="enable-startup-probes" value="false"/>
<nvpair id="cib-bootstrap-options-start-failure-is-fatal" name="start-failure-is-fatal" value="false"/>
<nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="false"/>
<nvpair id="cib-bootstrap-options-cluster-recheck-interval" name="cluster-recheck-interval" value="5min"/>
</cluster_property_set>
</crm_config>
<nodes>
<node id="1" uname="node1"/>
</nodes>
<resources>
<primitive class="ocf" id="SNMP_node1" provider="pacemaker" type="ClusterMon">
<instance_attributes id="SNMP_node1-instance_attributes">
<nvpair id="SNMP_node1-instance_attributes-extra_options" name="extra_options" value="-E /opt/occ/test/tools/PCSESA.sh"/>
<nvpair id="SNMP_node1-instance_attributes-user" name="user" value="root"/>
</instance_attributes>
<operations>
<op id="SNMP_node1-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
<op id="SNMP_node1-start-interval-0s" interval="0s" name="start" timeout="20s"/>
<op id="SNMP_node1-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
</operations>
<meta_attributes id="SNMP_node1-meta_attributes">
<nvpair id="SNMP_node1-meta_attributes-priority" name="priority" value="10"/>
<nvpair id="SNMP_node1-meta_attributes-failure-timeout" name="failure-timeout" value="120s"/>
</meta_attributes>
</primitive>
</resources>
<constraints/>
</configuration>
<status>
<node_state id="1" uname="node1" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
<lrm id="1">
<lrm_resources/>
</lrm>
<transient_attributes id="1">
<instance_attributes id="status-1"/>
</transient_attributes>
</node_state>
</status>
</cib>
--Debug Stdout End--
--Debug Stderr Start--
--Debug Stderr End--
Running: /usr/sbin/crm_mon --help-all
Environment:
LC_ALL=C
Finished running: /usr/sbin/crm_mon --help-all
Return value: 0
--Debug Stdout Start--
Usage:
crm_mon [OPTION?]
Provides a summary of cluster's current state.
Outputs varying levels of detail in a number of different formats.
Help Options:
-?, --help Show help options
--help-all Show all help options
--help-output Show output help
--help-display Show display options
--help-additional Show additional options
--help-deprecated Show deprecated options
Output Options:
--output-as=FORMAT Specify output format as one of: console (default), html, text, xml
--output-to=DEST Specify file name for output (or "-" for stdout)
--html-cgi Add CGI headers (requires --output-as=html)
--html-stylesheet=URI Link to an external stylesheet (requires --output-as=html)
--html-title=TITLE Specify a page title (requires --output-as=html)
--text-fancy Use more highly formatted output (requires --output-as=text)
Display Options:
-I, --include=SECTION(s) A list of sections to include in the output.
See `Output Control` help for more information.
-U, --exclude=SECTION(s) A list of sections to exclude from the output.
See `Output Control` help for more information.
--node=NODE When displaying information about nodes, show only what's related to the given
node, or to all nodes tagged with the given tag
--resource=RSC When displaying information about resources, show only what's related to the given
resource, or to all resources tagged with the given tag
-n, --group-by-node Group resources by node
-r, --inactive Display inactive resources
-f, --failcounts Display resource fail counts
-o, --operations Display resource operation history
-t, --timing-details Display resource operation history with timing details
-c, --tickets Display cluster tickets
-m, --fence-history=LEVEL Show fence history:
0=off, 1=failures and pending (default without option),
2=add successes (default without value for option),
3=show full history without reduction to most recent of each flavor
-L, --neg-locations Display negative location constraints [optionally filtered by id prefix]
-A, --show-node-attributes Display node attributes
-D, --hide-headers Hide all headers
-R, --show-detail Show more details (node IDs, individual clone instances)
-b, --brief Brief output
-s, --simple-status Display the cluster status once as a simple one line output (suitable for nagios)
Additional Options:
-i, --interval=TIMESPEC Update frequency (default is 5 seconds)
-1, --one-shot Display the cluster status once on the console and exit
-d, --daemonize Run in the background as a daemon.
Requires at least one of --output-to and --external-agent.
-p, --pid-file=FILE (Advanced) Daemon pid file location
-E, --external-agent=FILE A program to run when resource operations take place
-e, --external-recipient=RCPT A recipient for your program (assuming you want the program to send something to someone).
-W, --watch-fencing Listen for fencing events. For use with --external-agent.
Deprecated Options:
-h, --as-html=FILE Write cluster status to the named HTML file.
Use --output-as=html --output-to=FILE instead.
-X, --as-xml Write cluster status as XML to stdout. This will enable one-shot mode.
Use --output-as=xml instead.
-N, --disable-ncurses Disable the use of ncurses.
Use --output-as=text instead.
-w, --web-cgi Web mode with output suitable for CGI (preselected when run as *.cgi).
Use --output-as=html --html-cgi instead.
Application Options:
-$, --version Display software version and exit
-V, --verbose Increase debug output (may be specified multiple times)
-Q, --quiet Be less descriptive in output.
Notes:
If this program is called as crm_mon.cgi, --output-as=html --html-cgi will
automatically be added to the command line arguments.
Time Specification:
The TIMESPEC in any command line option can be specified in many different
formats. It can be just an integer number of seconds, a number plus units
(ms/msec/us/usec/s/sec/m/min/h/hr), or an ISO 8601 period specification.
Output Control:
By default, a certain list of sections are written to the output destination.
The default varies based on the output format - XML includes everything, while
other output formats will display less. This list can be modified with the
--include and --exclude command line options. Each option may be given multiple
times on the command line, and each can give a comma-separated list of sections.
The options are applied to the default set, from left to right as seen on the
command line. For a list of valid sections, pass --include=list or --exclude=list.
Interactive Use:
When run interactively, crm_mon can be told to hide and display various sections
of output. To see a help screen explaining the options, hit '?'. Any key stroke
aside from those listed will cause the screen to refresh.
Examples:
Display the cluster status on the console with updates as they occur:
crm_mon
Display the cluster status on the console just once then exit:
crm_mon -1
Display your cluster status, group resources by node, and include inactive resources in the list:
crm_mon --group-by-node --inactive
Start crm_mon as a background daemon and have it write the cluster status to an HTML file:
crm_mon --daemonize --output-as html --output-to /path/to/docroot/filename.html
Start crm_mon and export the current cluster status as XML to stdout, then exit:
crm_mon --output-as xml
--Debug Stdout End--
--Debug Stderr Start--
--Debug Stderr End--
Running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
Environment:
LC_ALL=C
Finished running: /usr/sbin/crm_mon --one-shot --inactive --output-as xml
Return value: 0
--Debug Stdout Start--
<pacemaker-result api-version="2.20" request="/usr/sbin/crm_mon --one-shot --inactive --output-as xml">
<summary>
<stack type="corosync"/>
<current_dc present="true" version="2.1.4-1.2.1.4.git.el8-dc6eb4362e6" name="node1" id="1" with_quorum="true"/>
<last_update time="Thu Nov 24 01:18:36 2022"/>
<last_change time="Thu Nov 24 01:10:33 2022" user="root" client="cibadmin" origin="node1"/>
<nodes_configured number="1"/>
<resources_configured number="1" disabled="0" blocked="0"/>
<cluster_options stonith-enabled="false" symmetric-cluster="false" no-quorum-policy="ignore" maintenance-mode="false" stop-all-resources="false" stonith-timeout-ms="60000" priority-fencing-delay-ms="0"/>
</summary>
<nodes>
<node name="node1" id="1" online="true" standby="false" standby_onfail="false" maintenance="false" pending="false" unclean="false" health="green" shutdown="false" expected_up="true" is_dc="true" resources_running="0" type="member"/>
</nodes>
<resources>
<resource id="SNMP_node1" resource_agent="ocf::pacemaker:ClusterMon" role="Stopped" active="false" orphaned="false" blocked="false" managed="true" failed="false" failure_ignored="false" nodes_running_on="0"/>
</resources>
<node_history/>
<status code="0" message="OK"/>
</pacemaker-result>
--Debug Stdout End--
--Debug Stderr Start--
--Debug Stderr End--
Writing to a temporary file /tmp/tmpjuk0gzwo.pcs:
--Debug Content Start--
<cib crm_feature_set="3.15.0" validate-with="pacemaker-3.8" epoch="171" num_updates="1" admin_epoch="0" cib-last-written="Thu Nov 24 01:10:33 2022" update-origin="node1" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="1">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-have-watchdog" name="have-watchdog" value="false"/>
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.4-1.2.1.4.git.el8-dc6eb4362e6"/>
<nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
<nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="OCC"/>
<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
<nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
<nvpair id="cib-bootstrap-options-startup-fencing" name="startup-fencing" value="false"/>
<nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot"/>
<nvpair id="cib-bootstrap-options-enable-startup-probes" name="enable-startup-probes" value="false"/>
<nvpair id="cib-bootstrap-options-start-failure-is-fatal" name="start-failure-is-fatal" value="false"/>
<nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="false"/>
<nvpair id="cib-bootstrap-options-cluster-recheck-interval" name="cluster-recheck-interval" value="5min"/>
</cluster_property_set>
</crm_config>
<nodes>
<node id="1" uname="node1"/>
</nodes>
<resources>
<primitive class="ocf" id="SNMP_node1" provider="pacemaker" type="ClusterMon">
<instance_attributes id="SNMP_node1-instance_attributes">
<nvpair id="SNMP_node1-instance_attributes-extra_options" name="extra_options" value="-E /opt/occ/test/tools/PCSESA.sh"/>
<nvpair id="SNMP_node1-instance_attributes-user" name="user" value="root"/>
</instance_attributes>
<operations>
<op id="SNMP_node1-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
<op id="SNMP_node1-start-interval-0s" interval="0s" name="start" timeout="20s"/>
<op id="SNMP_node1-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
</operations>
<meta_attributes id="SNMP_node1-meta_attributes">
<nvpair id="SNMP_node1-meta_attributes-priority" name="priority" value="10"/>
<nvpair id="SNMP_node1-meta_attributes-failure-timeout" name="failure-timeout" value="120s"/>
</meta_attributes>
</primitive>
</resources>
<constraints/>
</configuration>
<status>
<node_state id="1" uname="node1" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
<lrm id="1">
<lrm_resources/>
</lrm>
<transient_attributes id="1">
<instance_attributes id="status-1"/>
</transient_attributes>
</node_state>
</status>
</cib>
--Debug Content End--
Writing to a temporary file /tmp/tmp3xicyijc.pcs:
--Debug Content Start--
<cib crm_feature_set="3.15.0" validate-with="pacemaker-3.8" epoch="171" num_updates="1" admin_epoch="0" cib-last-written="Thu Nov 24 01:10:33 2022" update-origin="node1" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="1">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-have-watchdog" name="have-watchdog" value="false"/>
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.4-1.2.1.4.git.el8-dc6eb4362e6"/>
<nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
<nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="OCC"/>
<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
<nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
<nvpair id="cib-bootstrap-options-startup-fencing" name="startup-fencing" value="false"/>
<nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot"/>
<nvpair id="cib-bootstrap-options-enable-startup-probes" name="enable-startup-probes" value="false"/>
<nvpair id="cib-bootstrap-options-start-failure-is-fatal" name="start-failure-is-fatal" value="false"/>
<nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="false"/>
<nvpair id="cib-bootstrap-options-cluster-recheck-interval" name="cluster-recheck-interval" value="5min"/>
</cluster_property_set>
</crm_config>
<nodes>
<node id="1" uname="node1"/>
</nodes>
<resources>
<primitive class="ocf" id="SNMP_node1" provider="pacemaker" type="ClusterMon">
<instance_attributes id="SNMP_node1-instance_attributes">
<nvpair id="SNMP_node1-instance_attributes-extra_options" name="extra_options" value="-E /opt/occ/test/tools/PCSESA.sh"/>
<nvpair id="SNMP_node1-instance_attributes-user" name="user" value="root"/>
</instance_attributes>
<operations>
<op id="SNMP_node1-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
<op id="SNMP_node1-start-interval-0s" interval="0s" name="start" timeout="20s"/>
<op id="SNMP_node1-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
</operations>
<meta_attributes id="SNMP_node1-meta_attributes">
<nvpair id="SNMP_node1-meta_attributes-priority" name="priority" value="10"/>
<nvpair id="SNMP_node1-meta_attributes-failure-timeout" name="failure-timeout" value="120s"/>
</meta_attributes>
</primitive>
</resources>
<constraints/>
</configuration>
<status>
<node_state id="1" uname="node1" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
<lrm id="1">
<lrm_resources/>
</lrm>
<transient_attributes id="1">
<instance_attributes id="status-1"/>
</transient_attributes>
</node_state>
</status>
</cib>
--Debug Content End--
Running: /usr/sbin/crm_diff --original /tmp/tmpjuk0gzwo.pcs --new /tmp/tmp3xicyijc.pcs --no-version
Environment:
LC_ALL=C
Finished running: /usr/sbin/crm_diff --original /tmp/tmpjuk0gzwo.pcs --new /tmp/tmp3xicyijc.pcs --no-version
Return value: 0
--Debug Stdout Start--
--Debug Stdout End--
--Debug Stderr Start--
--Debug Stderr End-
Thanks and Regards,
S Sathish S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20221124/92213d83/attachment-0001.htm>
More information about the Users
mailing list