LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2010, 03:43 AM   #1
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
Mrtg graphing with script


I try to graph No of open files using simple shell script but it's unsuccessful to draw graph continuously. Please anybody assist me to solve this problem, following are my mrtg.cfg and script.
And i am bit unclear with MaxBytes. How we can define this?

PHP Code:
# No of open files
#Target[Est-files]: `lsof | wc -l | awk '{printf("%d\n",$1); printf("%d\n",0); printf("%d\n",0)}'`
Target[Est-files]: `/usr/local/mrtg/scripts/openfiles_lsof.sh`
Title[Est-files]: Number of open files Est
PageTop
[Est-files]:<H1>Number of open files Est</H1>
MaxBytes[Est-files]: 4000
Options
[Est-files]: growright,unknaszero,nopercent,gauge
LegendI
[Est-files]:
LegendO[Est-files]: No of files:
Ylegend[Est-files]: count
ShortLegend
[Est-files]:  files
Legend1
[Est-files]: Number of open files
#Directory[Est-files]: system 
The script seems ok
PHP Code:
#!/bin/sh
echo 0
DATA
=`lsof | wc -l`
if [ 
$DATA ]
then echo 0
else
echo 
$DATA awk '{printf("%d\n",$1)}'
echo 0
echo 0
fi
#echo 0 
Quote:
Script Output:-
# ./openfiles_lsof.sh
0
2051
0
0

Last edited by kirukan; 03-26-2010 at 03:47 AM.
 
Old 03-26-2010, 04:50 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Original Poster
Rep: Reputation: 148Reputation: 148
For further information herewith attached graph, please ignore the green plot because it has changed to LegendO(blue)
Attached Thumbnails
Click image for larger version

Name:	est-files-day.png
Views:	4
Size:	1.5 KB
ID:	3161  

Last edited by kirukan; 03-26-2010 at 04:54 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best MRTG graphing software? abefroman Linux - Networking 1 11-01-2009 04:14 PM
Graphing TuxFreak Linux - Software 1 02-27-2005 05:29 PM
MRTG - Graphing multiple IPs on one router? gnirtS Linux - Networking 1 02-04-2005 08:04 PM
rrd mrtg & mrtg-rrd.cgi ducati620 Linux - Newbie 0 06-03-2004 08:29 PM
Graphing AMMullan Linux - Software 1 11-16-2003 02:11 AM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration