Re: looking for packages versions of running daemons

2009-09-14 Thread Cameron Hutchison
Manoj Srivastava writes: >On Thu, Sep 10 2009, Cameron Hutchison wrote: >> Version 3 (below) is "properly" written, in a functional style. It's much >> longer, but much easier to read. The main() function is very simple, >> as is each individual function. It's written in such a way that you >> c

Re: looking for packages versions of running daemons

2009-09-14 Thread Manoj Srivastava
On Thu, Sep 10 2009, Cameron Hutchison wrote: > Version 3 (below) is "properly" written, in a functional style. It's much > longer, but much easier to read. The main() function is very simple, > as is each individual function. It's written in such a way that you > can add extra filters if you wan

Re: looking for packages versions of running daemons

2009-09-12 Thread Cameron Hutchison
Javier Barroso writes: >On Thu, Sep 10, 2009 at 11:33 PM, Cameron Hutchison wrote: >> >> /proc/pid/cmdline usually has ASCII NUL separated fields, which awk does >> not split, so usually you have to use xargs -0. I noticed some cases >> where the args were space separated (perl script), so I nee

Re: looking for packages versions of running daemons

2009-09-11 Thread Thomas Dickey
On Fri, 11 Sep 2009, Thomas Dickey wrote: On Fri, 11 Sep 2009, Thomas Dickey wrote: however, Debian's packagage maintainer for mawk has not responded to any of package... -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net -- To UNSUBSCRIBE, email t

Re: looking for packages versions of running daemons

2009-09-11 Thread Thomas Dickey
On Fri, 11 Sep 2009, Thomas Dickey wrote: On Fri, 11 Sep 2009, Javier Barroso wrote: On Thu, Sep 10, 2009 at 11:33 PM, Cameron Hutchison wrote: /proc/pid/cmdline usually has ASCII NUL separated fields, which awk does not split, so usually you have to use xargs -0. I noticed some cases where

Re: looking for packages versions of running daemons

2009-09-11 Thread Thomas Dickey
On Fri, 11 Sep 2009, Javier Barroso wrote: On Thu, Sep 10, 2009 at 11:33 PM, Cameron Hutchison wrote: /proc/pid/cmdline usually has ASCII NUL separated fields, which awk does not split, so usually you have to use xargs -0. I noticed some cases where the args were space separated (perl script),

Re: looking for packages versions of running daemons

2009-09-11 Thread Javier Barroso
On Thu, Sep 10, 2009 at 11:33 PM, Cameron Hutchison wrote: > Javier Barroso writes: > >>> is this "xargs: echo: terminated by signal 13" the output it should be? >>Probably, substituting: > >> bin=$(xargs -n 1 -0 echo < /proc/$pid/cmdline | awk '{print $1 ; exit}') > >>with > >>bin=$(awk '{print

Re: looking for packages versions of running daemons

2009-09-10 Thread Cameron Hutchison
Israel Garcia writes: >[...] it seems when the script found >duplicate lines, like named/tcp and named/udp it only show one, se >below: >vps204:/usr/local/bin# netstat -lntup >tcp0 0 67.212.94.125:530.0.0.0:* >LISTEN 23874/named >tcp0 0 127.0.0.1:53

Re: looking for packages versions of running daemons

2009-09-10 Thread Israel Garcia
On 9/10/09, Cameron Hutchison wrote: > Cameron Hutchison writes: > >>Israel Garcia writes: >>>On 9/10/09, Cameron Hutchison wrote: > Version 3 (below) is "properly" written, in a functional style. [...] > >>>Well, in version 3 I see no output when I run the script...I double >>>check but I

Re: looking for packages versions of running daemons

2009-09-10 Thread Cameron Hutchison
Cameron Hutchison writes: >Israel Garcia writes: >>On 9/10/09, Cameron Hutchison wrote: >>> Version 3 (below) is "properly" written, in a functional style. [...] >>Well, in version 3 I see no output when I run the script...I double >>check but I dont know where the problem is. >Hmmm, work fo

Re: looking for packages versions of running daemons

2009-09-10 Thread Cameron Hutchison
Israel Garcia writes: >On 9/10/09, Cameron Hutchison wrote: >> Version 3 (below) is "properly" written, in a functional style. [...] >Well, in version 3 I see no output when I run the script...I double >check but I dont know where the problem is. Hmmm, work for me (tm). Try isolating the failu

Re: looking for packages versions of running daemons

2009-09-10 Thread Cameron Hutchison
Javier Barroso writes: >> is this "xargs: echo: terminated by signal 13" the output it should be? >Probably, substituting: > bin=$(xargs -n 1 -0 echo < /proc/$pid/cmdline | awk '{print $1 ; exit}') >with >bin=$(awk '{print $1; exit}' /proc/$pid/cmdline) >will solved the issue >But I'm not su

Re: looking for packages versions of running daemons

2009-09-10 Thread Javier Barroso
On Thu, Sep 10, 2009 at 4:21 PM, Israel Garcia wrote: >>>case ruby. See below: > Hi Cameron, > >> >> Ok. Here's version 2. Fixes are: >>   * Sorted the output by port number and removed duplicates. Duplicates >>     happen when a daemon listens on multiple IP addresses (samba is one). >>   * Skip

Re: looking for packages versions of running daemons

2009-09-10 Thread Israel Garcia
On 9/10/09, Cameron Hutchison wrote: > Cameron Hutchison writes: > >>Ok. Here's version 2. Fixes are: > > One more iteration before I go to bed. > > Version 2 was the quickly knocked together script that looks ugly and > hard to read, but is nice and compact. Maybe "nice" isn't the right > word.

Re: looking for packages versions of running daemons

2009-09-10 Thread Israel Garcia
>>case ruby. See below: Hi Cameron, > > Ok. Here's version 2. Fixes are: > * Sorted the output by port number and removed duplicates. Duplicates > happen when a daemon listens on multiple IP addresses (samba is one). > * Skip non-existent processes > * remove (delete) from the end of rea

Re: looking for packages versions of running daemons

2009-09-10 Thread Cameron Hutchison
Cameron Hutchison writes: >Ok. Here's version 2. Fixes are: One more iteration before I go to bed. Version 2 was the quickly knocked together script that looks ugly and hard to read, but is nice and compact. Maybe "nice" isn't the right word. Version 3 (below) is "properly" written, in a funct

Re: looking for packages versions of running daemons

2009-09-10 Thread Cameron Hutchison
Israel Garcia writes: >On 9/9/09, Cameron Hutchison wrote: >> Israel Garcia writes: >> >>>I have more than 10 debian (etch and lenny) servers and I want to find >>>a way to know remotely on every server: >> >>>1. Name of running daemons and ports (tcp/udp) they're using. >>>2. Version of the pac

Re: looking for packages versions of running daemons

2009-09-09 Thread Israel Garcia
On 9/9/09, Ron Johnson wrote: > On 2009-09-09 23:30, Israel Garcia wrote: >> On 9/9/09, Cameron Hutchison wrote: >>> Israel Garcia writes: >>> I have more than 10 debian (etch and lenny) servers and I want to find a way to know remotely on every server: 1. Name of running daemons

Re: looking for packages versions of running daemons

2009-09-09 Thread Ron Johnson
On 2009-09-09 23:30, Israel Garcia wrote: On 9/9/09, Cameron Hutchison wrote: Israel Garcia writes: I have more than 10 debian (etch and lenny) servers and I want to find a way to know remotely on every server: 1. Name of running daemons and ports (tcp/udp) they're using. 2. Version of the p

Re: looking for packages versions of running daemons

2009-09-09 Thread Israel Garcia
On 9/9/09, Cameron Hutchison wrote: > Israel Garcia writes: > >>I have more than 10 debian (etch and lenny) servers and I want to find >>a way to know remotely on every server: > >>1. Name of running daemons and ports (tcp/udp) they're using. >>2. Version of the package (installed by APT) used by

Re: looking for packages versions of running daemons

2009-09-09 Thread Cameron Hutchison
Israel Garcia writes: >I have more than 10 debian (etch and lenny) servers and I want to find >a way to know remotely on every server: >1. Name of running daemons and ports (tcp/udp) they're using. >2. Version of the package (installed by APT) used by these daemons. >3. Version of the latest pac

looking for packages versions of running daemons

2009-09-09 Thread Israel Garcia
I have more than 10 debian (etch and lenny) servers and I want to find a way to know remotely on every server: 1. Name of running daemons and ports (tcp/udp) they're using. 2. Version of the package (installed by APT) used by these daemons. 3. Version of the latest package (from deb mirros) used b