On Tue, Nov 18, 2003 at 02:10:09PM -0500, Salvatore D. Tepedino wrote:
> 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.
Uneccessary? The LVS kernel code always returns values in hex.
So they have to be converted somewhere along the line.
Weather by ipvsadm, libipvs or something else.
> 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.
libipvs should make life easier. But if you want to work in
something other than C it might be easier to access /proc directly
if the information you need is there.
--
Horms
|