PTA - ptaq.service not showing when using snmpwalk
Symptom
When configuring snmp on PTA and running snmwalk using the following document:-
https://community.cyberark.com/s/article/Monitoring-PTA-using-SNMP
ptaqservice is not being returned.
Environment
12.2;12.6;14.0;14.2;14.4;14.6;15.0 Privileged Access Manager (PAM, self-hosted) PTA
PTA
Cause
This is some expected but behaviour SNMP - it limits character fields to 128
If you run 'ps -ef | grep -i ptaq' on the PTA server, this is displayed
ptaq 122972 1 0 Jan22 ? 01:34:30 /opt/pta/infra/jvm/jre17/bin/java -Xms128M -Xmx5G -XX:MaxHeapFreeRatio=60 -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/etc/opt/pta/ptaq/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/tmp/ptaq --add-reads=java.xml=java.logging --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED -Dactivemq.classpath=/etc/opt/pta/ptaq:/opt/pta/ptaq/../lib/: -Dactivemq.home=/opt/pta/ptaq -Dactivemq.base=/opt/pta/ptaq -Dactivemq.conf=/etc/opt/pta/ptaq -Dactivemq.data=/var/lib/pta/ptaq -Djolokia.conf=file:/etc/opt/pta/ptaq/jolokia-access.xml -jar /opt/pta/ptaq/bin/ptaq.jar start -Djava.rmi.server.hostname=127.0.0.1
When running snmpwalk you can see the same cmd line string (The process is java, as it is a java process not a .sh script):
HOST-RESOURCES-MIB::hrSWRunParameters.122972 = STRING: "-Xms128M -Xmx5G -XX:MaxHeapFreeRatio=60 -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/et"
The line is truncated before it gets to the string 'ptaq'
Resolution
A custom SNMP cmd can be added in snmpd.conf such as:
extend psfull /bin/ps -eo pid,args
This, when running snmpwalk with 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull', will return the output of that command, without truncation.
Alternatively, the non-truncated text can be used to monitor ptaq, as 'logging' doesn't appear anywhere else in other cmdline of processes.