ActiveXperts Network Monitor - Home page
Download ActiveXperts Network Monitor 7.1  (7327 KB - .exe file)
Using Linux Shell Script with ActiveXperts Network Monitor
Introduction
Network Monitor SSH checks
Samples
SSH vs. RSH
Introduction
SSH Secure Shell allows secure network services over an insecure network, such as the Internet.
With SSH, ActiveXperts Network Monitor can login onto a remote machine running the SSH daemon,
and execute a command or shell script.
ActiveXperts Network Monitor requires the output (i.e. StdOut) to be formatted according to the following syntax:
[ SUCCESS | ERROR | UNCERTAIN]: { <explanation> } { DATA:<value>}
The <explanation> will be shown in the 'Last Response' column in the Manager application. The <value> field will be shown in the 'Data' column in the Manager application.
The shell script must reside on the Linux machine, i.e. you cannot use a script that resides on the Windows monitoring server. The shell script must have the 'Execute' permission flag set.
Here's a sample shell script that works with Network Monitor. This script checks the size of a directory:
#!/bin/sh
# Validate number of arguments
if [ $# -ne 2 ] ; then
echo "UNCERTAIN: Invalid number of arguments - Usage: directory_size "
exit 1
fi
# Check the size of the directory specified
if [ -d "$1" ]; then
SIZE=`du -s "$1" | awk '{ print $1; }'`
if [ $SIZE -le $2 ] ; then
echo "SUCCESS: Size of directory=[$SIZE KB], maximum allowed=[$2 KB] DATA:$SIZE"
else
echo "ERROR: Size of directory=[$SIZE KB], maximum allowed=[$2 KB] DATA:$SIZE"
fi
else
echo "UNCERTAIN: $1 is not a directory"
fi
Network Monitor SSH checks
ActiveXperts Network Monitor ships with a selection of shell scripts. These scripts work out of the box.
The scripts are located in the <installation-dir>\Scripts\Monitor (Linux) (e.g., <C:\Program Files\ActiveXperts\Network Monitor\Scripts\Monitor (Linux).
you must copy the script to the linux machine first in order to run the script.
Samples
CPU usage
Click here for a CPU monitoring script.
Memory usage
Click here for a memory monitoring script.
|