This script allows monitoring IPFire from a client by predefined queries via SSH Console on the IPFire. This requires a small connection script on the client side and the query script on the IPFire side.
This script may be used, extended and supplemented. Thanks again to ummeegge for his work!
Homepage | execution |
---|---|
iftop | iftop |
libstatgrab | saidar -c |
bwm-ng | bwm-ng |
htop | htop |
tcpick | tcpick -i red0 -C |
The monitoring script was exemplarily saved on /mnt/mo_scripts
/ directory. The script needs to be made executable.
This script must be stored on the client side.
filename = monstat.sh
#!/bin/bash - #### ## Fun in the joy script ## ## Open SSH session and call ipfire monitoring script ## ## ummeegge & 5p9 29.03.13, incor. IPFire #### ssh -p 222 -t root@IP-IPfire /mnt/mo_scripts/network_info.sh
You have to change the IP of IPFire and the path of the monitoring script. After depositing or creation the script must be still made executable:
chmod +x monstat.sh
Put this script on the IPFire.
filename = network_info.sh
#!/bin/bash - ################################################################################################################################ ## Fun in the joy script 2 ## ## nettraffic script ? ## ## ummeegge 15.05.12, incor. IPFire ## ################################################################################################################################ datum=`date rechner=`hostname os=`uname -s ip_addr=`grep $rechner /etc/hosts | awk '{print$1}' echo "" echo "" echo "" echo "" echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" echo -e "\033[1;37;40m NETWORK MONITORING SCRIPT \033[0m" echo "" echo -e "\033[1;36;40mState from: $datum --- From host with IP: $ip_addr --- Named: $rechner \033[0m" echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" echo "" echo -e "\033[0;31;40mYou can finish this and/or close this SSH session by pressing [ctrl c] \033[0m" sleep 5 echo "" echo "==========================================================================================================================" echo -e "\033[1;37;40m Saidar \033[0m" echo "Lets start first with SYSTEM RESOURCE CHECK" echo "Saidar checks RAM (Swap), HDD, Network traffic and some more in realtime " echo -e "\033[0;31;40mthis goes endless until you press [q] \033[0m" echo "==========================================================================================================================" echo "" read -p "To start the system realtime check Press [Enter] ... " echo -e "\033[0;31;40mthis goes endless until you press [q] \033[0m" saidar -c echo "" echo "" echo "==========================================================================================================================" echo -e "\033[1;37;40m bwm-ng \033[0m" echo "Bandwith monitor for all interfaces " echo -e "\033[0;31;40mthis goes endless until you press [q] \033[0m" echo -e "\033[0;31;40mwhile running this binary press [h] for more options \033[0m" echo "==========================================================================================================================" echo "" read -p "To start the bwm-ng Press [Enter] ..." bwm-ng echo "" echo "==========================================================================================================================" echo -e "\033[1;37;40m iftop \033[0m" echo "Network traffic with IPs and bandwidth " echo -e "\033[0;31;40mthis goes endless until you press [q] \033[0m" echo -e "\033[0;31;40mWhile running this binary press [h] for more options \033[0m" echo "==========================================================================================================================" echo "" read -p "To start iftop Press [Enter] ..." iftop echo "" echo "==========================================================================================================================" echo -e "\033[1;37;40m htop \033[0m" echo "htop is an interactive process viewer " echo -e "\033[0;31;40mthis goes endless until you press [q] \033[0m" echo -e "\033[0;31;40mWhile running this binary press [h] for more options \033[0m" echo "==========================================================================================================================" echo "" read -p "To start htop Press [Enter] ..." htop echo "" echo "==========================================================================================================================" echo -e "\033[1;37;40m Tcpick \033[0m" echo "Syn sent und Syn receive etc. " echo -e "\033[0;31;40mPress [control-c] to exit \033[0m" echo "==========================================================================================================================" sleep 5 tcpick -i red0 -C echo "" echo "" echo "" echo "Thats it... " echo -e "\033[1;36;40mState from: $datum --- From host with IP: $ip_addr --- Named: $rechner \033[0m" echo " If there are more machines to check be patient?"
After dropping / creating the script must be made executable:
chmod +x network_info.sh
Older Revisions • January 23 at 11:28 pm • Jon