All Apps and Add-ons

check process is still running on each server

grahamrb
Explorer

I'm trying to figure out a way to verify that a process is running on each server. We have a clustered environment with 4 servers running WebSphere application server and as such I want to confirm that the cluster is healthy at the process level.

This is the closest I've gotten:

 sourcetype="ps" "SOME_UNIQUE_PROCESS_NAME" | timechart count by host

Pushing this into an area graph gets close except during some intervals the ps source isn't sampled and therefore returns 0 results instead of 1. It also isn't very robust as as it relies on the span of each sample of the timechart.

I'm using the Splunk for Unix and Linux app which is where the sourcetype of 'ps' comes from.
http://apps.splunk.com/app/273

grahamrb
Explorer

I think I figured it out, could someone validate if this is the most efficient way to do this:

 sourcetype="ps" | eval processexists=if(match(_raw, "SOME_UNIQUE_PROCESS_NAME"), 1, 0) | timechart span=1m avg(processexists) by host

As long as you know you're going to get more than one event from ps within the span of 1 minute it should work. The only thing that could get dodgy is it'll drop down to 0.5 between going from 1 and 0 if you are sampling every 30 seconds.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...