") end -- run program to band width usage update binary to update DB util.appendDebugOut("Exec = " .. os.execute("/pfrm2.0/bin/fwBwMon /tmp/system.db update")) stats = db.getRow("SystemStatistics","_ROWID_","1") or {} lanInterface=db.getRow("interfaceStats","interfaceName","bdg1") or {} --[[ If connection type is not Dhcp or ifstatic then get row from ppp1 interface for WAN1 --]] -- Check for connection type for WAN1 local logIfName = "WAN1" local connectionType = "" local wanInterface = nil local connectionTypeRow = db.getRowWhere("NimfConf", "LogicalIfName = '".. logIfName .."' and AddressFamily = 2") if(connectionTypeRow ~= nil) then connectionType = connectionTypeRow["NimfConf.ConnectionType"] end if(connectionType ~= "dhcpc" and connectionType ~= "ifStatic")then wanInterface = db.getRow ("interfaceStats","interfaceName","ppp1") or {} else wanInterface = db.getRow ("interfaceStats", "interfaceName", "eth1") or {} end local portConfig = db.getRow("ConfigPort", "_ROWID_", "1") local dmzInterface = nil --[[ If connection type is not Dhcp or ifstatic then get row from ppp2 interface for WAN2 --]] -- Check for connection type for WAN2 if(portConfig["ConfigPort.LogicalIfName"] == "WAN2") then connectionTypeRow = db.getRowWhere("NimfConf", "LogicalIfName = '".. portConfig["ConfigPort.LogicalIfName"] .."' and AddressFamily = 2") if(connectionTypeRow ~= nil) then connectionType = connectionTypeRow["NimfConf.ConnectionType"] end if(connectionType ~= "dhcpc" and connectionType ~= "ifStatic")then dmzInterface = db.getRow ("interfaceStats", "interfaceName", "ppp2") or {} else dmzInterface = db.getRow ("interfaceStats", "interfaceName", "eth2") or {} end else dmzInterface = db.getRow ("interfaceStats", "interfaceName", "eth2") or {} end -- Getting Bandwidth Counters. local appNames = db.getDistinctValues("BwMonStat", "AppName") local bwCounters = {} local usedAppsCounter = {} local idx = 1 for k,v in pairs (appNames) do local counterSum = nil bwCounters[idx] = {} usedAppsCounter[idx] = {} bwCounters[idx]["BwMonStat.AppName"] = v["BwMonStat.AppName"] or '' usedAppsCounter[idx]["BwMonStat.AppName"] = v["BwMonStat.AppName"] or '' if (intName1 == "ALL") then counterSum = db.getTable("BwMonStat", false, "SELECT sum(Counter) Counter FROM BwMonStat where AppName='" .. v["BwMonStat.AppName"] .. "'") else counterSum = db.getTable("BwMonStat", false, "SELECT sum(Counter) Counter FROM BwMonStat where LogicalIfName='" .. intName1 .. "' and AppName='" .. v["BwMonStat.AppName"] .. "'") end if (counterSum ~= nil and #counterSum == 1) then bwCounters[idx]["BwMonStat.Counter"] = counterSum[1]["Counter"] or '0' else bwCounters[idx]["BwMonStat.Counter"] = '0' end if (intName2 == "ALL") then counterSum = db.getTable("BwMonStat", false, "SELECT sum(Counter) Counter FROM BwMonStat where AppName='" .. v["BwMonStat.AppName"] .. "'") else counterSum = db.getTable("BwMonStat", false, "SELECT sum(Counter) Counter FROM BwMonStat where LogicalIfName='" .. intName2 .. "' and AppName='" .. v["BwMonStat.AppName"] .. "'") end if (counterSum ~= nil and #counterSum == 1) then usedAppsCounter[idx]["BwMonStat.Counter"] = counterSum[1]["Counter"] or '0' else usedAppsCounter[idx]["BwMonStat.Counter"] = '0' end idx = idx + 1 end ?> $|COMPANY_NAME|$ : $|APP_NAME|$
$| statusMessage or '' |$
DashboardLogout
$| initialDescription or '' |$
 
Bandwidth Usage
Select Interface:
(in KB)
  Applications  
 
Used Applications
Select Interface:
 
CPU Utilization
CPU usage by user: $| stats["SystemStatistics.CpuUsedByUser"] or '0' |$ %
CPU usage by kernel: $| stats["SystemStatistics.CpuUsedByKernel"] or '0' |$ %
CPU idle: $| stats["SystemStatistics.CpuIdle"] or '0' |$ %
CPU waiting for IO: $| stats["SystemStatistics.CpuWaitingForIO"] or '0' |$ %
 
Memory Utilization
Total Memory: $| stats["SystemStatistics.MemoryTotal"] or '0' |$ KB
Used Memory: $| stats["SystemStatistics.MemoryUsed"] or '0' |$ KB
Free Memory: $| stats["SystemStatistics.MemoryFree"] or '0' |$ KB
Cached Memory: $| stats["SystemStatistics.MemoryCached"] or '0' |$ KB
Buffer Memory: $| stats["SystemStatistics.MemoryBuffers"] or '0' |$ KB
 
Interface (LAN)
Incoming Packets: : $| lanInterface["interfaceStats.rx_packets"] or '' |$
Outgoing Packets: $| lanInterface["interfaceStats.tx_packets"] or '' |$
Dropped In Packets: $| lanInterface["interfaceStats.rx_dropped"] or '' |$
Dropped Out Packets: $| lanInterface["interfaceStats.tx_dropped"] or '' |$
 
Interface (WAN1)
Incoming Packets: : $| wanInterface["interfaceStats.rx_packets"] or '' |$
Outgoing Packets: $| wanInterface["interfaceStats.tx_packets"] or '' |$
Dropped In Packets: $| wanInterface["interfaceStats.rx_dropped"] or '' |$
Dropped Out Packets: $| wanInterface["interfaceStats.tx_dropped"] or '' |$
 
Interface (DMZ/WAN2)
Incoming Packets: $| dmzInterface["interfaceStats.rx_packets"] or '' |$
Outgoing Packets: $| dmzInterface["interfaceStats.tx_packets"] or '' |$
Dropped In Packets: $| dmzInterface["interfaceStats.rx_dropped"] or '' |$
Dropped Out Packets: $| dmzInterface["interfaceStats.tx_dropped"] or '' |$
 
Interface (VLAN)
Port Incoming Packets Outgoing Packets Dropped In Packets Dropped Out Packets
$| v["networkInterface.LogicalIfName"] or '' |$ $| intStatsRow["interfaceStats.rx_packets"] or '' |$ $| intStatsRow["interfaceStats.tx_packets"] or '' |$ $| intStatsRow["interfaceStats.rx_dropped"] or '' |$ $| intStatsRow["interfaceStats.tx_dropped"] or '' |$
 
Active Info
/tmp/netStat.txt") local f = assert(io.open("/tmp/netStat.txt", "r")) local t = f:read("*all") f:close() ?>
ICMP Received: $| t |$
Active VPN Tunnels: $| activeVpnStatCount |$
Active VLANs: $| vlanCount |$
Active Interfaces: $| activeInterfaceCount |$
Helpful Hints...
$| helpfullHints or '' |$