Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
howto:simple_network_monitoring [2008/08/01 12:35] – created 194.141.47.101howto:simple_network_monitoring [2010/10/02 17:26] – external edit 127.0.0.1
Line 1: Line 1:
 +===== Simple network monitoring using Genmon plugin =====
 +
 Follow is the code of script that can make this Follow is the code of script that can make this
 I recomment to save in you home directory with name netmonitor.sh (with +x permissions), next have to add new item (On panel right click -> 'Add New Item' -> 'Generic Monitor') and for command type ~/netmonitor.sh . With no label tick and  period for update 1 I recomment to save in you home directory with name netmonitor.sh (with +x permissions), next have to add new item (On panel right click -> 'Add New Item' -> 'Generic Monitor') and for command type ~/netmonitor.sh . With no label tick and  period for update 1
    
-Screenshot: 
-[img]http://aug01.imgshare.us/9li.png[/img] 
  
-----+**Screenshot:** \\ {{http://aug01.imgshare.us/9li.png}} 
 + 
 +//Old picture was removed, please update//
  
 +<code bash>
 #!/usr/bin/env bash #!/usr/bin/env bash
 #netmonitor.sh #netmonitor.sh
Line 24: Line 27:
 fi fi
  
-MY_output=`netstat -i|grep ${interface}|awk '{print $12}'`+MY_output=`netstat -i|grep $interface|awk '{print $12}'`
 MY_icontheme="/usr/share/icons/${ICON_THEME}/${ICON_SIZE}x${ICON_SIZE}/status/" MY_icontheme="/usr/share/icons/${ICON_THEME}/${ICON_SIZE}x${ICON_SIZE}/status/"
  
Line 36: Line 39:
     echo "<img>${MY_icontheme}/network-error.png</img>"     echo "<img>${MY_icontheme}/network-error.png</img>"
 fi fi
-MY_ip=`/sbin/ifconfig eth0|grep inet|awk {'print $2'}|cut -d":" -f2`+MY_ip=`/sbin/ifconfig $interface|grep inet|awk {'print $2'}|cut -d":" -f2`
 echo "<tool> echo "<tool>
     Hostname: ${HOSTNAME}      Hostname: ${HOSTNAME}
Line 44: Line 47:
     </tool>"     </tool>"
 exit exit
- +</code> 
----- +