<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 17 February 2014 23:24, Jeremy Laidman <span dir="ltr"><<a href="mailto:jlaidman@rebel-it.com.au" target="_blank">jlaidman@rebel-it.com.au</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div class="">On 17 February 2014 18:48, Jeremy Laidman <span dir="ltr"><<a href="mailto:jlaidman@rebel-it.com.au" target="_blank">jlaidman@rebel-it.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>For this reason, it seems to make sense that the "link" lines are probably the best for this, as I would think that they would show packets contained only in physical frames (ethernet or some other medium).</div>


</div></blockquote><div></div></div></div></div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class=""><div>So I'm proposing that the FreeBSD client be adjusted from this:<br></div></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">echo "[ifstat]"</div>
<div class="gmail_extra">netstat -i -b -n | egrep -v "^lo|<Link"</div><div><br></div><div>To this:</div><div><br></div><div><div>echo "[ifstat]"</div><div>netstat -i -b -n | egrep "<Link"</div>


</div><div></div></div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">

<div class="gmail_extra"><div>Seem reasonable?  Would anyone be adversely impacted by this suggested change?<br></div></div></div></blockquote><div><br></div><div>Anyone?  Nobody else using FreeBSD?</div><div><br></div><div>

I've implemented a work-around that works for me, by using the following line in xymonclient-freebsd.sh:</div><div><br></div><div>netstat -ibn|egrep "<Link|Name"| grep -v ^lo | while read A B C D E F G; do [ $A = "Name" ] || { C=<a href="http://0.0.0.0/0">0.0.0.0/0</a>; D=0.0.0.0; }; printf "%-5s %5s %-13s %-17s %12s %6s %14s %14s %6s %14s %6s\n" $A $B $C $D $E $F $G; done<br>

</div><div><br></div><div>The output now only includes interface lines with "<Link" that are not loopback devices (thus ignoring all the non-physical entries), and the "<Link#1>" and MAC address lines have been replaced with dummy values that parse correctly on the server.  I now have useful interface graphs for my FreeBSD systems.</div>

<div><br></div><div>This is an ugly hack, and I only want this in place until a proper solution can be implemented.</div><div><br></div><div>So, I'm proposing that the xymonclient-freebsd.sh script be modified to use this line for [ifstat]:</div>

<div><br></div><div>  netstat -ibn | egrep "<Link|Name"|grep -v ^lo</div><div><br></div><div>(This could leave the loopback addresses in place, and I don't think anyone would mind.)</div><div><br></div><div>

Then, the following (untested) patch to do_ifstat.c.</div><div><br></div><div>What say ye all?</div><div><br></div><div>Cheers</div><div>Jeremy</div><div><br></div><div><div><font face="courier new, monospace">--- do_ifstat.c.orig    2014-02-20 13:35:33.000000000 +1100</font></div>

<div><font face="courier new, monospace">+++ do_ifstat.c 2014-02-20 13:42:32.000000000 +1100</font></div><div><font face="courier new, monospace">@@ -27,8 +27,10 @@</font></div><div><font face="courier new, monospace"><br>

</font></div><div><font face="courier new, monospace"> /* Name MTU  Network        IP            Ipkts Ierrs Ibytes Opkts Oerrs Obytes Coll */</font></div><div><font face="courier new, monospace"> /* lnc0 1500 <a href="http://172.16.10.0/24">172.16.10.0/24</a> 172.16.10.151 26    -     1818   26    -     1802   -    */</font></div>

<div><font face="courier new, monospace">+/* Name MTU  Network  Address             Ipkts Ierrs Ibytes Opkts Oerrs Obytes Coll */</font></div><div><font face="courier new, monospace">+/* em0  1500 <Link#1> 00:11:22:33:44:55   26    -     1818   26    -     1802   -    */</font></div>

<div><font face="courier new, monospace"> static const char *ifstat_freebsd_exprs[] = {</font></div><div><font face="courier new, monospace">-       "^([a-z0-9]+)\\s+\\d+\\s+[0-9.\\/]+\\s+[0-9.]+\\s+\\d+\\s+[0-9-]+\\s+(\\d+)\\s+\\d+\\s+[0-9-]+\\s+(\\d+)\\s+[0-9-]+"</font></div>

<div><font face="courier new, monospace">+       "^([a-z0-9]+)\\s+\\d+\\s+<Link#\\d+>\\s+[:0-9]+\\s+\\d+\\s+[0-9-]+\\s+(\\d+)\\s+\\d+\\s+[0-9-]+\\s+(\\d+)\\s+[0-9-]+"</font></div><div><font face="courier new, monospace"> };</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"> /* Name    Mtu Network       Address         Ipkts Ierrs Idrop     Ibytes    Opkts Oerrs     Obytes  Coll */</font></div>

</div><div><br></div></div></div></div>