Hello everyone
I've problem with feedbackd because i want to calculate cpu and bandwidth. So i
use shell script.
I use feedbackd 0.5 and i monitor plugins with my shell script.My shell script
creat text and use text to calculate and send weight to feedbackd.
First my shell script is getweight.sh:
"#!/bin/bash
sar 1 1 > cpu.txt #monitor cpu load
ifstat 2 2 > band.txt #monitor interface
echo $(./calculate.o) #calculate and print weight"
This script doesn't work. My weight is always 0.
Then, I creat 2 shell script. first script use to feedbackd. And another use to
crontab.
The first script is getweight.sh:
"#!/bin/bash
echo $(./calculate.o)"
And the second is getstat.sh:
"#!/bin/bash
let i=20
while ($i expr '>' 0)
do
sar 1 1 > cpu.txt
ifstat 2 2 > band.txt
done"
And i use crontab to run it every minute with
0-59/1 * * * * /myscript/getstat.sh
It's work. But when it is creating cpu.txt and band.txt., my weight is wrong.
How can I creat file like cpuload plugin?
kos.student.psu.ac.th
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
|