Welcome to the IPFire Wiki

This wiki is a community-maintained resource about everything there is to know about IPFire. Join us and help us improving it!

Looking for something?

Use the search and find answers to everything about IPFire. If you cannot find what you are looking for, join our community and talk to fellow IPFire users, developers and everybody else involved in the project.

IPFire Community

System Status over Fire-Dialog

With Dialog it's easy to graphical output to shell scripts and make them interactive.

Use this tool to check i.a. appropriate services and messages in real time without moving through the system.

To embed scripts in a clear manner dialog offers a quick and relatively easy to learn communication interface.

Remote Access to IPFire addons with remote-dialog

Like with the Montioring-Script you can access fire-dialog script from a remote workstation via remote access:

#!/bin/bash -

####
# open SSH Session and run Fire-Dialog Script
#ummeegge & 5p9 03.06.13, incor. IPFire
####

ssh -p 222 -t root@IP-IPfire /mnt/harddisk/mo_scripts/addonmenu.sh

After saving / creating the script it must be made executable:

chmod +x remote-dialog.sh

Fire-Dialog Script

This example script calls IPFire addons (and software currently not yet available through Pakfire) with different options.

This example is based on the example of http://bash.cyberciti.biz/guide/A_menu_box. For more very insightful tutorials see http://bash.cyberciti.biz.

This addons address the issue of network and hardware monitoring.

Required add-ons on IPFire

An overview of addons currently included in Pakfire can be found at here.

Not yet standard in Pakfire:

Note!
The three items above are not yet standard in Pakfire and must be downloaded and copied into directory /opt/pakfire/tmp, unpacked via tar xvf [package_name].ipfire and installed with ./install.sh

Example script for download and install:

cd /opt/pakfire/tmp
wget https://people.ipfire.org/[package_name].ipfire
tar xvf [package_name].ipfire
./install.sh

The following script addonmenu.sh was saved under /mnt/harddisk/mo_scripts and made executable with:

chmod u+x /mnt/harddisk/mo_scripts/addonmenu.sh

filename = /mnt/harddisk/mo_scripts/addonmenu.sh

#!/bin/bash -

###########################################################################
# addonmenu.sh - A sample shell script to display IPFire Addons over dialog
# Example script taken from http://bash.cyberciti.biz/guide/A_menu_box
# Modified for a easier usage of the IPFire Addons
# ummeegge 11.06.2013
###########################################################################

INPUT=/tmp/menu.sh.$$

#
# Purpose - display output using msgbox
#  $1 -> set msgbox height
#  $2 -> set msgbox width
#  $3 -> set msgbox title
#
function display_output(){
    local h=${1-10}         # box height default 10
    local w=${2-41}         # box width default 41
    local t=${3-Output}         # box title
    dialog --backtitle "Network And System Monitoring with IPFire Addons" \
--title "${t}" \
--clear \
--msgbox "$(<$OUTPUT)" ${h} ${w}
}

#
# Purpose - display network traffic monitoring (with a lot of stuff)
#
function show_iptraf(){
    display_output 4 80 "IPTraf-ng is a versatile network monitoring tool, press [ctrl-c] to quit"
    iptraf-ng
}

#
# Purpose - display network traffic and bandwith for IP´s
#
function show_iftop(){
    display_output 4 75 "iftop checks IP based bandwith, press [H] for more, press [q] to quit"
    iftop -i red0
}

#
# Purpose - display network traffic and bandwith for interfaces
#
function show_bwmng(){
  display_output 4 60 "bwm-ng monitors the bandwith for all interfaces"
    bwm-ng
}

#
# Purpose - display network connectivity to google.com
#
function show_mtr(){
    display_output 4 70 "MTR checks Network connectivity to google, press [q] to quit"
    mtr www.google.com
}

#
# Purpose - display CPU, processes, load, memory, swap, network I/O, disk I/O
#
function show_statgrab(){
    display_output 4 85 " Saidar displays CPU, processes, load, memory, swap and more, press [q] to quit"
    saidar -c
}

#
# Purpose - display textmode sniffs and connection status
#
function show_tcpick(){
    display_output 4 65 "Tcpick Sniffs your connection status, press [ctr-c] to quit"
    tcpick -C -i red0
}

#
# Purpose - display frequently updated processes
#
function show_htop(){
    display_output 4 70 "HTOP is an Interactive process viewer, press [q] to quit"
    htop
}

#
# Purpose - display hardware and statistics
#
function show_dstat(){
    display_output 4 75 "dstat is versatile statistic tool, press [ctrl-c] to quit"
    dstat -tcndylp
}

#
# Purpose - display system power consumption
#
function show_powertop(){
  display_output 4 60 "Powertop checks the system power consumption"
    powertop
}

#
# set infinite loop
#
while true
do

### display main menu ###
dialog --clear \
--backtitle "--- Network Monitoring with IPFire Addons ---" \
--title " M A I N - M E N U " \
--menu "You can use the UP/DOWN arrow keys \n\
Press [e] and [ENTER] to quit Dialog.\n\
Choose the TASK" 20 70 4 \
iptraf-ng "IPTraf-ng is a versatile network monitoring tool" \
iftop "IP based Network Bandwith Monitor" \
bwm-ng "Bandwith monitor for all interfaces" \
mtr "Investigate your network connectivity" \
statgrab "System statistics for hardware and network" \
tcpick "Sniffs your connection status" \
htop "Interactive process viewer" \
dstat "Performance test, benchmarking and troubleshooting" \
powertop "Checks your system power consumption" \
Exit "Exit to the shell" 2>"${INPUT}"

menuitem=$(<"${INPUT}")


# make decsion
case $menuitem in
    iptraf-ng) show_iptraf;;
    iftop) show_iftop;;
    bwm-ng) show_bwmng;;
    mtr) show_mtr;;
      statgrab) show_statgrab;;
    tcpick) show_tcpick;;
    htop) show_htop;;
      dstat) show_dstat;;
      powertop) show_powertop;;
    Exit) echo "Bye"; break;;
esac

done

# if temp files found, delete em
[ -f $INPUT ] && rm $INPUT

Still missing addons can be downloaded from http://people.ipfire.org/~ummeegge.

Edit Page ‐ Yes, you can edit!

Older Revisions • August 26 at 10:04 pm • Jon