Wednesday, May 9, 2012

Hyperic SIGAR PTQL (Process Table Query Language)

java -jar /opt/hyperic/agent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/lib/sigar-1.6.4.jar

to find a WebLogic process:

ps State.Name.eq=java,CredName.User.eq=soa,Args.*.ct=-Dweblogic.Name=osbdv2ms1

to find all processes:

to find all Java processes:
ps State.Name.eq=java

sigar> ps State.Name.eq=java
6300 pvernet 09:08 1.2G 81M - R 0:15 java:weblogic.Server
9512 ??? ??? 340M 107M - R ??? java
7728 ??? ??? 311M 42M - R ??? java
4784 ??? ??? 908M 325M - R ??? java
4512 pvernet 10:30 262M 18M - R 0:1 java:org.hyperic.sigar.cmd.Runner

you can do ps 6300

sigar> ps 6300
6300 pvernet 09:08 1.2G 82M - R 0:15 java:weblogic.Server

Official doc of Process Table Query Language

SIGAR doc (SIGAR=System Information Gatherer)

You even have a SIGAR API

1 comment:

emam keela said...

good job, I was wondering if it's possible to use SIGAR to collect process table information and write it into openTSDB? if yes could you please show me how to do it or you can recommend me some links.
thanks in advance