Netgate SG-1000 microFirewall

Author Topic: Generating RRD graphs ... ERROR: Not enough arguments  (Read 9099 times)

0 Members and 1 Guest are viewing this topic.

Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5240
  • Karma: +11/-1
    • View Profile
Generating RRD graphs ... ERROR: Not enough arguments
« on: August 12, 2008, 09:32:40 am »
I just upgraded from 1.2.1-RC1 built Wed Jul 30 23:26:13 EDT 2008 to 1.2.1-RC1 built Tue Aug 12 11:15:49 EDT 2008

During the startup I noticed:

Quote
Generating RRD graphs ... ERROR: Not enough arguments
ERROR: Not enough arguments
done.

If I recall correctly, I also saw this message before the upgrade.



Offline databeestje

  • Hero Member
  • *****
  • Posts: 1048
  • Karma: +1/-0
  • It just might be your luck day, if you only knew.
    • View Profile
Re: Generating RRD graphs ... ERROR: Not enough arguments
« Reply #1 on: August 12, 2008, 03:30:56 pm »
Can I get your /var/db/rrd/updaterrd.sh please?

Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5240
  • Karma: +11/-1
    • View Profile
Re: Generating RRD graphs ... ERROR: Not enough arguments
« Reply #2 on: August 12, 2008, 04:41:30 pm »
Here it is:
Quote
$ more /var/db/rrd/updaterrd.sh
#!/bin/sh

counter=1
while [ "$counter" -ne 0 ]
do

# polling traffic for interface opt1 ath0
/usr/local/bin/rrdtool update /var/db/rrd/opt1-traffic.rrd N:\
`/usr/bin/netstat -nbf link -I ath0 | /usr/bin/awk '{getline 2;print $7 ":" $10}'`

# polling packets for interface opt1 ath0
/usr/local/bin/rrdtool update /var/db/rrd/opt1-packets.rrd N:\
`/usr/bin/netstat -nbf link -I ath0 | /usr/bin/awk '{getline 2;print $5 ":" $8}'`

# polling traffic for interface lan rl0
/usr/local/bin/rrdtool update /var/db/rrd/lan-traffic.rrd N:\
`/usr/bin/netstat -nbf link -I rl0 | /usr/bin/awk '{getline 2;print $7 ":" $10}'`

# polling packets for interface lan rl0
/usr/local/bin/rrdtool update /var/db/rrd/lan-packets.rrd N:\
`/usr/bin/netstat -nbf link -I rl0 | /usr/bin/awk '{getline 2;print $5 ":" $8}'`

# polling traffic for interface opt2 vr0
/usr/local/bin/rrdtool update /var/db/rrd/opt2-traffic.rrd N:\
`/usr/bin/netstat -nbf link -I vr0 | /usr/bin/awk '{getline 2;print $7 ":" $10}'`

# polling packets for interface opt2 vr0
/usr/local/bin/rrdtool update /var/db/rrd/opt2-packets.rrd N:\
`/usr/bin/netstat -nbf link -I vr0 | /usr/bin/awk '{getline 2;print $5 ":" $8}'`

# polling traffic for interface wan udav0
/usr/local/bin/rrdtool update /var/db/rrd/wan-traffic.rrd N:\
`/usr/bin/netstat -nbf link -I udav0 | /usr/bin/awk '{getline 2;print $7 ":" $10}'`

# polling packets for interface wan udav0
/usr/local/bin/rrdtool update /var/db/rrd/wan-packets.rrd N:\
`/usr/bin/netstat -nbf link -I udav0 | /usr/bin/awk '{getline 2;print $5 ":" $8}'`
get_quality_stats_wan () {
   packetloss_wan=100
   roundtrip_wan=0
   local out_wan
   out_wan=` ping -c 5 -q 192.168.37.1 `
   if [ $? -eq 0 ]; then
      packetloss_wan=` echo $out_wan | cut -f18 -d' ' | cut -c -1 `
      roundtrip_wan=` echo $out_wan | cut -f24 -d' ' | cut -f2 -d'/' `
   fi
   /usr/local/bin/rrdtool update /var/db/rrd/wan-quality.rrd N:$packetloss_wan:$roundtrip_wan
}

get_quality_stats_wan &

` pfctl -vsq | awk 'BEGIN {printf "/usr/local/bin/rrdtool update /var/db/rrd/wan-queues.rrd " } { if (($1 == "queue") && ( $2 ~ /^q/ )) { dsname = dsname ":" $2 ; q=1; } else if (($4 == "bytes:") && ( q == 1 ) ) { dsdata = dsdata ":" $5 ; q=0; } } END { dsname = substr(dsname,2); dsdata = substr(dsdata,2); printf "-t " dsname " N:" dsdata }' dsname="" dsdata=""`

` pfctl -vsq | awk 'BEGIN {printf "/usr/local/bin/rrdtool update /var/db/rrd/wan-queuesdrop.rrd " } { if (($1 == "queue") && ( $2 ~ /^q/ )) { dsname = dsname ":" $2 ; q=1; } else if (($4 == "bytes:") && ( q == 1 ) ) { dsdata = dsdata ":" $8 ; q=0; } } END { dsname = substr(dsname,2); dsdata = substr(dsdata,2); printf "-t " dsname " N:" dsdata }' dsname="" dsdata=""`


# polling traffic for interface ipsec enc0
/usr/local/bin/rrdtool update /var/db/rrd/ipsec-traffic.rrd N:\
`/usr/bin/netstat -nbf link -I enc0 | /usr/bin/awk '{getline 2;print $6 ":" $9}'`

# polling packets for interface ipsec enc0
/usr/local/bin/rrdtool update /var/db/rrd/ipsec-packets.rrd N:\
`/usr/bin/netstat -nbf link -I enc0 | /usr/bin/awk '{getline 2;print $4 ":" $7}'`

pfctl_si_out="` /sbin/pfctl -si > /tmp/pfctl_si_out `"
pfctl_ss_out="` /sbin/pfctl -ss > /tmp/pfctl_ss_out`"
pfrate="` cat /tmp/pfctl_si_out | egrep "inserts|removals" | awk '{ pfrate = $3 + pfrate } {print pfrate}'|tail -1 `"
pfstates="` cat /tmp/pfctl_ss_out | egrep -v "<\-.*?<\-|\->.*?\->" | wc -l|sed 's/ //g'`"
pfnat="` cat /tmp/pfctl_ss_out | egrep '<\-.*?<\-|\->.*?\->' | wc -l|sed 's/ //g' `"
srcip="` cat /tmp/pfctl_ss_out | egrep -v '<\-.*?<\-|\->.*?\->' | grep '\->' | awk '{print $3}' | awk -F: '{print $1}' | sort -u|wc -l|sed 's/ //g' `"
dstip="` cat /tmp/pfctl_ss_out | egrep -v '<\-.*?<\-|\->.*?\->' | grep '<\-' | awk '{print $3}' | awk -F: '{print $1}' | sort -u|wc -l|sed 's/ //g' `"
/usr/local/bin/rrdtool update /var/db/rrd/system-states.rrd N:$pfrate:$pfstates:$pfnat:$srcip:$dstip

`/usr/bin/top -d 2 -s 1 0 | /usr/bin/awk '{gsub(/%/, "")} BEGIN { printf "/usr/local/bin/rrdtool update /var/db/rrd/system-processor.rrd " } { if ( $2 == "processes:" ) { processes = $1; } else if ( $1 == "CPU" ) { user = $3; nice = $5; sys = $7; interrupt = $9; } } END { printf "N:"user":"nice":"sys":"interrupt":"processes }'`

sleep 60
done

I suspect the problem might be that on my system:
Quote
# pfctl -vsq
No queue in use
#

Offline databeestje

  • Hero Member
  • *****
  • Posts: 1048
  • Karma: +1/-0
  • It just might be your luck day, if you only knew.
    • View Profile
Re: Generating RRD graphs ... ERROR: Not enough arguments
« Reply #3 on: August 16, 2008, 03:47:46 pm »
That would explain it, it's triggering the queues graphs collector eventhough it is disabled.

Hmmmm. I'll look into it.

Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5240
  • Karma: +11/-1
    • View Profile
Re: Generating RRD graphs ... ERROR: Not enough arguments
« Reply #4 on: December 19, 2008, 11:36:52 pm »
Any advance on this issue? Its still happening in 1.2.1-RC4.