#!/bin/bash
#
# NAME
# ----
# - xymon_asterisk_dahdi.sh
#
# DESCRIPTION
# -----------
# - Script to monitor Digium Asterisk Hardware Device Interface (DAHDI)
# channels on a DIGIUM TDM410P 4-port FXS/FXO analog card in an
# Asterisk system. It will probably work with other analog cards in
# an asterisk system which use the DAHDI drivers.
#
# - The most current version of this script may be
# found at http://www.revpol.com/xymon_asterisk_dahdi_script
#
# - Instructions to integrate the output of this script to be monitored
# and graphed by a Xymon server may also be found at the above URL
#
# - If you find this script useful, I'd love to know. Send me an email,
# or leave a comment on that script page!
#
# William A. Arlofski
# Reverse Polarity, LLC
# 860-824-2433 Office
# http://www.revpol.com/
#
# HISTORY
# -------
# - 20130531 - HBD - Initial version release. This script currently makes no
# attempt to monitor more than one card in a system. This is due
# to the fact that we only have a 4-channel analog Digium card
# currently in production to test with.
#
###############################################################################
#
# Copyright (C) 2013 William A. Arlofski - waa-at-revpol-dot-com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# or visit http://www.gnu.org/licenses/gpl.txt
#
###############################################################################
#
# Set some variables
# ------------------
#
# Name of Xymon test
# ------------------
COLUMN="DAHDI"
# Add an administrative message to the top of the report page
# Not necessary, but can be a quick way to know what server
# is monitoring the DAHDI channels, and perhaps provide some
# instructional information
# -----------------------------------------------------------
ADMINMSG="This report generated by ${MACHINEDOTS}
${MACHINEDOTS} resides in the main server room
Contact John Doe x1234 with questions
"
# Optional Footer message
# -----------------------
FOOTER="