OpenNMS - pacemaker - LSB compliance

I need to create a cluster for OpeNMS application - two nodes.

the VIP and shared folder is working properly.
As a next step I need to add a lsb resource as opennms script. It is visible by pcs:

[root@qbvpr-node1 ~]#  pcs resource list lsb
lsb:avagent - avagent
lsb:BCKUPSVR - BCKUPSVR
lsb:opennms - Powered By OpenNMS daemon for network monitoring
[root@qbvpr-node1 ~]#

I have also checked the opennms is lsb compliance.

Now Im creating a new resource of lsb:

[root@qbvpr-node1 ~]# pcs resource create opennms lsb:opennms op start timeout=300s op stop timeout=120s op monitor interval=60s  timeout=40s --group mediation
[root@qbvpr-node1 ~]#

When Im checking the status I see that pacemake is starting opennms but the return code is 160, it is causing the failure, plese see below:

[root@qbvpr-node1 ~]#/etc/init.d/opennms status ; echo "result: $?"
opennms is stopped
result: 3
[root@qbvpr-node1 ~]# /etc/init.d/opennms status ; echo "result: $?"
opennms is partially running
result: 160
[root@qbvpr-node1 ~]# /etc/init.d/opennms status ; echo "result: $?"
opennms is partially running
result: 160
[root@qbvpr-node1 ~]# pcs status
Cluster name: IT_MED_CLUSTER
Cluster Summary:
  * Stack: corosync
  * Current DC: QBVPR-node1 (version 2.1.2-4.el8_6.2-ada5c3b36e2) - partition with quorum
  * Last updated: Thu Sep  1 20:08:05 2022
  * Last change:  Thu Sep  1 20:05:29 2022 by root via cibadmin on QBVPR-node1
  * 2 nodes configured
  * 3 resource instances configured

Node List:
  * Node QBVPR-node2: standby
  * Online: [ QBVPR-node1 ]

Full List of Resources:
  * Resource Group: mediation:
    * cluster_ip        (ocf::heartbeat:IPaddr2):        Started QBVPR-node1
    * opennms_fs        (ocf::heartbeat:Filesystem):     Started QBVPR-node1
    * opennms   (lsb:opennms):   FAILED QBVPR-node1 (Monitoring)

Failed Resource Actions:
  * opennms_monitor_60000 on QBVPR-node1 'error' (1): call=2557, status='complete', last-rc-change='Thu Sep  1 20:07:51 2022', queued=0ms, exec=1965ms

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled
[root@qbvpr-node1 ~]#

How to avoid the returned value 160 in case of opennms is partially running?
Any idea is appreciated. Thank you in advance.

Don’t use /etc/inint.d/opennms status ?

dino2gnt
sorry I dont understand your comment.
the lsb resource requires the agent be located in the /etc/init.d
I have shown the result of /etc/inint.d/opennms status only as my investigation, pacemaker is not able to start opennms because is receiving status 160 means is not lsb compliance, please clarify

If the init script isn’t lsb compliant and using it as an lsb resource for Pacemaker doesn’t work, then don’t use the init script as an lsb resource. Try service, or systemd, or any other cluster resource type that works.