LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Graphing connections with RRDTool

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Graphing connections with RRDTool
From: "Salvatore D. Tepedino" <sal@xxxxxxxxxxxx>
Date: Tue, 18 Nov 2003 14:10:09 -0500
On Tue, 2003-11-18 at 03:22, Horms wrote:
> On Tue, Nov 18, 2003 at 02:18:49AM -0500, Salvatore D. Tepedino wrote:
> > One small problem, currently, is that the update script greps the output
> > of ipvsadm for 'Route' (The type of cluster this is) as I can find no
> > other unique string to grep for from the ipvsadm output. Anyone know of
> > a way to get more parse-friendly output? Something that only listed the
> > real servers and usual stuff that's on their lines would be ideal, but a
> > way to eliminate the header would be fine as well, as I could just grep
> > out the VIP.
> 
> You have two main options here.
> 
> 1. Write something that quiries the kernel directly,
>    libipvs should be able to help you here.

Well, this was my first try (not libipvs, but querying /proc/net), but
what I can apparently get from the kernel is the same output of ipvsadm
(/proc/net/ip_vs), but the IPs and Port are in hex, which would not be
too hard to convert, but it's an extra unnecessary step. Or I could
parse the output of /proc/net/ip_conntrack, but that would be alot more
work, and since I'm working in bash, it's likely that ipvsadm is faster.
I'll have to look into libipvs and see if it'll help, although I've not
ventured into C programming since college... Would be interesting.

> 
> 2. Add a(nother) option to ipvsadm.
> 
> Personally I would go for 1 as it is probably quicker.
> Though you could try 2 and see if you can twist Wensong's arm
> into including it in the release.

Well, it's not too much of a problem, except when someone's using more
than one type of cluster on the same directors, but then copying one
line and changing what it's grepping for would add the additional
results to the list. 

> 
> Very nice :-)

Thanks! :)
-- 
Salvatore D. Tepedino <sal@xxxxxxxxxxxx>

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