Graph running scripts

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
brononius
Posts: 27
Joined: Fri Dec 30, 2011 4:53 am

Graph running scripts

Post by brononius »

Is there a way to check if a script is running? I've got a small script running on my linux machine (=same as the cacti machine).
And I would like to check (graph) with cacti if this script is running.

I was thinking of using something like:
<cacti>/scripts/linux_ps.sh

Code: Select all

SEARCH_STRING=$1
ps -ef | grep $SEARCH_STRING | grep -v grep >/dev/null

RETVAL=$?
[ $RETVAL -eq 0 ] && echo 1
[ $RETVAL -ne 0 ] && echo 0
Now I should create a graph template that allows me to insert the data to search for. I can't figure out how i can create a template that allows you to insert the variable...
Cacti: 0.8.7i PIA on Ubuntu (linuxmce) with NET-SNMP 5.4.1 / RRDTool 1.2.x
Plugins: Manage062, Syslog122, Mactrack29, Settings071, Weathermap097a, Quicktree02, Thold049, Configmanager0826, Aggregate070, Realtime043, Nettools015
Private use: 24 hosts (and trying to integrate it into linuxmce)
Professional use 1635 nodes with 3616 graphs (backup / syslog / weathermaps...)
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Graph running scripts

Post by noname »

How to make graph from result of script:
- Walkthrough: My First Data Input Method - Cacti Docs
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest