LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Feedbackd and shell script

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [lvs-users] Feedbackd and shell script
Cc: "kosol student.psu.ac.th" <kos_au@xxxxxxxxxxx>
From: Jeremy Kerr <jk@xxxxxxxxxx>
Date: Mon, 14 Jan 2008 10:29:09 +1100
Hi,

> 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.

This sounds like a pretty complicated way to do this.

> 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.

Why doesn't calculate.o just read the output of sar and ifstat itself? 
Then you wouldn't need a shell script at all, you can just get the 
feedbackd exec plugin to invoke calculate.o directly.

However, it looks like this is your main problem - if you can debug why 
this simpler script isn't working (permissions? environment 
variables?), then making it work under feedbackd should be trivial.

> How can I creat file like cpuload plugin?

If you wanted to write a plugin directly (instead of a standalone progam 
that feedbackd executes), just copy cpuload plugin, modify it as you 
like, then compile it alongside the other plugins.

Cheers,


Jeremy


<Prev in Thread] Current Thread [Next in Thread>