Hi G. Ashok,

The first think to do is to get log files which contains the information, for 
instance do you have any logging server or maybe you can get output via CLI 
(Command Line Interface). 

In the first cause all you need to do is do some filtering and give your 
information to the mrtg service, 
On the second scenario you will have to probably remotely gather this 
information using ssh to execute remote commands or maybe rsh. Than all is 
simple I will attach a file which contains few mrtg configuration scenarios 
with the some scripts which are realy easy to read.

If you need more help plz send some details on what kind of information do you 
wana graph and how do you obtain them, and I will try to help you with your 
script. 

Keep in mind I don't know how windows mrtg works so I am speaking only for 
linux servers that serves mrtg.

By the way I found these scripts on the net and I am not sure where did I find 
them but they gave me really great help creating my script and mrtg.cfg, so 
this is not my work some1 else deserves the thanking.

Fehmi

Date: Sat, 24 Apr 2010 15:58:37 +0530
Subject: Re: [mrtg] How to monitor non SNMP Device using MRTG
From: [email protected]
To: [email protected]
CC: [email protected]

Thank you guys for giving such a valuable information saying that you have 
implemented MRTG for non SNMP devices.But someone says, to use smokeping, write 
scripts which have to return four values. 
First of all I I think I don't want to switch to some other tools like 
smokeping as I know about MRTG. So, if you guys tried this, could you please 
post some practical scripts( might be complex ) so that I can implement for my 
non SNMP devices and then I can go for some other tools like smokeping for some 
enhancements.
Kind Regards,G Ashok Kumar,Softential.On Sat, Apr 24, 2010 at 1:24 PM, Fehmi 
Dumani <[email protected]> wrote:






You can check this page http://mrtg.meulie.net/doc/mrtg-reference.en.html it 
helped me set it up for my own  use.

Check the part 

External Monitoring Scripts
                If you want to monitor something which does not provide
data via snmp you can use some external program to do
the data gathering.

                The external command must return 4 lines of output:

                
                        
Line 1
                                        current state of the first variable, 
normally 'incoming bytes 
count'

                                Line 2
                                        current state of the second variable, 
normally 'outgoing bytes 
count'

                                Line 3
                                        string (in any human readable format), 
telling the uptime of the
 target.

                                Line 4
                                        string, telling the name of the target.

                                
                                          
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. 
Learn more.


_______________________________________________

mrtg mailing list

[email protected]

https://lists.oetiker.ch/cgi-bin/listinfo/mrtg




                                          
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
EnableIPv6: no
WorkDir: /usr/nekoware/apache2/htdocs/_mrtg

Interval: 5

Title[load_avg]: Load average * 100
PageTop[load_avg]: <H1>Load average * 100</H1>
Options[load_avg]: nobanner,gauge,noinfo,nopercent
Target[load_avg]: `/usr/nekoware/etc/mrtg/load_avg.sh`
MaxBytes[load_avg]: 100
YLegend[load_avg]: LoadAvg * 100
Unscaled[load_avg]: ymwd
LegendI[load_avg]:
LegendO[load_avg]:
Suppress[load_avg]: y

Title[disk_usage]: Disk usage (GB)
PageTop[disk_usage]: <H1>Disk usage (GB)</H1>
Options[disk_usage]: nobanner,gauge,noinfo,nopercent
Target[disk_usage]: `/usr/nekoware/etc/mrtg/disk.sh`
kMG[disk_usage]: G
MaxBytes[disk_usage]: 35410400
YLegend[disk_usage]: Disk total/used
Unscaled[disk_usage]: ymwd
LegendI[disk_usage]:
LegendO[disk_usage]:
Suppress[disk_usage]: y

Title[memory_usage]: Memory usage (MB)
PageTop[memory_usage]: <H1>Memory usage (MB)</H1>
Options[memory_usage]: nobanner,gauge,noinfo,nopercent
Target[memory_usage]: `/usr/nekoware/etc/mrtg/mem.sh`
kMG[memory_usage]: M
MaxBytes[memory_usage]: 256
AbsMax[memory_usage]: 256
YLegend[memory_usage]: Mem total/free
Unscaled[memory_usage]: ymwd
LegendI[memory_usage]:
LegendO[memory_usage]:
Suppress[memory_usage]: y






  /usr/nekoware/etc/mrtg/load_avg.sh

Load Average multiplied by 100. Fetched from uptime. 


#!/bin/sh
DATA=`uptime`
FIRST=`echo $DATA | cut -f4 -d":" | cut -f1 -d","`
SECOND=`echo $DATA | cut -f4 -d":" | cut -f2 -d","`
VAL1=`echo "$FIRST*100" | bc | cut -f1 -d"."`
VAL2=`echo "$SECOND*100" | bc | cut -f1 -d"."`
echo $VAL1
echo $VAL2
echo 0
echo 0



/usr/nekoware/etc/mrtg/disk.sh

Disk usage. Fetched from df.

#!/bin/sh
DATA=`df -k /dev/root | tail -1`
VAL1=`echo $DATA | cut -f3 -d" "`
VAL2=`echo $DATA | cut -f4 -d" "`
echo $VAL1
echo $VAL2
echo 0
echo 0

/usr/nekoware/etc/mrtg/mem.sh

Memory usage. Fetched from top.

#!/bin/sh
DATA=`top -b | grep Memory`
TOTAL=`echo $DATA | cut -f2 -d" " | cut -f1 -d"M"`
FREE=`echo $DATA | cut -f6 -d" " | cut -f1 -d"M"`
echo $TOTAL
echo $FREE
echo 0
echo 0
_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to