In the last episode (Feb 25), Adam Lofstedt said:
> Hi all.  I'm running FreeBSD 4.7 with net-snmp-5.0.3_2.
> I have two NICs, and one of them has several IP's bound to it through
> ifconfig alias.  When I try to run MRTG, it only gives me the statistics
> for one of the aliased IPs (I think).
> System: in  
> Maintainer: [EMAIL PROTECTED] 
> Description: xl0  
> ifType: ethernetCsmacd (6) 
> ifName:  
> Max Speed: 1250.0 kBytes/s 
> Ip: ( 
> is the first aliased IP in /etc/rc.conf.  Does anyone
> know of a way to get statistics for each individual aliased IP?
> With the above output, does anyone know if I am actually getting
> statistics for all bound IP's combined, or for just that one single
> aliased IP?

You're getting stats for the physical interface.  I don't think
net-snmp lets you get stats for a single IP.  One workaround would be a
get-alias-stats script that pulls info from netstat for a particular IP:

#! /bin/sh
# usage: get-alias-stats <ip>
netstat -ibn -f inet | while read line ; do
  set -- $line
  if [ "$4" = "$ip" ] ; then
    echo $7
    echo ${10}
    uptime | sed -e "s/.*up \(.*\), .*user.*/\1/"

Call that in mrtg, and pass it the alias IP you're interested in:

Target[alias1]: `get-alias-stats`

        Dan Nelson

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to