Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] way to inquire status of T1 link


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
geisj at pagestation.com
Guest





PostPosted: Sat Apr 12, 2008 7:38 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

Thanks

Jerry
Back to top
JonP at inline.net
Guest





PostPosted: Sat Apr 12, 2008 7:53 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

Quoting Jerry Geis <geisj at pagestation.com>:

Quote:
Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

there are tools that watch syslogs for anythign with error or warning
in the entry, that will probably do the trick.

Quote:

Thanks

Jerry

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users



Jon Pounder

_/_/_/ _/ _/ _/ _/_/_/ _/ _/ _/_/_/_/
_/ _/_/ _/ _/ _/ _/_/ _/ _/_/
_/ _/ _/_/ _/ _/ _/ _/_/ _/
_/_/_/ _/ _/ _/_/_/_/ _/_/_/ _/ _/ _/_/_/_/


Inline Internet Systems Inc.
Thorold, Ontario, Canada

Tools to Power Your e-Business Solutions
www.inline.net
www.ihtml.com
www.ihtmlmerchant.com
www.opayc.com
Back to top
abalashov at evaristes...
Guest





PostPosted: Sat Apr 12, 2008 8:21 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

Jerry Geis wrote:
Quote:
Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

What sort of adaptor?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
jbailey at co.marshall...
Guest





PostPosted: Sat Apr 12, 2008 8:27 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

We use Nagios for network monitoring. We've got a check_pri script that should be fairly universal. It will return "critical" for any alarm. Feel free to use the script as you see fit. YMMV - may skin cats, etc (you know the disclaimer drill)...
#! /usr/bin/python

# Checks PRI status - returns similar to the following:
# PRI span 1/0: Provisioned, Up, Active / PRI span 2/0: Provisioned, Up, Active


import os, sys, socket

statusstring = ''

for file in os.popen('/usr/sbin/asterisk -rx "pri show spans"').readlines():
out = file[:-1]
if out.startswith('PRI'):
statusstring += ' / ' + out.strip()
if out.startswith('Unable to connect to remote asterisk'):
print "Unable to connect to Asterisk instance"
sys.exit(2)

print statusstring.strip()[2:]

if statusstring.strip()[2:].count("In Alarm") > 0:
sys.exit(2)

# Nagios Return Codes
# OK = 0
# Warning = 1
# Critical = 2
# Unknown = 3

sys.exit(0)



-Jon

----- Original Message -----
From: "Alex Balashov" <abalashov at evaristesys.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Sent: Saturday, April 12, 2008 8:21:09 PM GMT -06:00 US/Canada Central
Subject: Re: [asterisk-users] way to inquire status of T1 link

Jerry Geis wrote:
Quote:
Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

What sort of adaptor?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
thp at westhawk.co.uk
Guest





PostPosted: Sun Apr 13, 2008 10:38 am    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

You can also cat /proc/zaptel/1 and parse the output of that.
This doesn't tell you if asterisk is happy though.
For that you could use the asterisk SNMP (sub)agent

Tim.

----- Original Message -----
From: "Jerry Geis" <geisj at pagestation.com>
To: asterisk-users at lists.digium.com
Sent: Sunday, April 13, 2008 1:38:00 AM (GMT) Europe/London
Subject: [asterisk-users] way to inquire status of T1 link

Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

Thanks

Jerry
Back to top
tzafrir.cohen at xorco...
Guest





PostPosted: Sun Apr 13, 2008 1:35 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

On Sat, Apr 12, 2008 at 08:38:00PM -0400, Jerry Geis wrote:
Quote:
Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

Those are lower-layer alarms. They will also appear on zttool and 'cat
/proc/zaptel/*'

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
Back to top
jbailey at co.marshall...
Guest





PostPosted: Sun Apr 13, 2008 3:00 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

My guess is that you don't have any spans set up, or Asterisk doesn't have zaptel support... Is chan_zap.so loaded?

-Jon

----- Original Message -----
From: "Jerry Geis" <geisj at pagestation.com>
To: asterisk-users at lists.digium.com
Sent: Sunday, April 13, 2008 1:27:56 PM GMT -06:00 US/Canada Central
Subject: Re: [asterisk-users] way to inquire status of T1 link
When I execute the commands in my cli

pri show status
zap show status

I get errors for both commands.

I am running 1.4.19, with libpri 1.4.3, and zaptel 1.4.10.

how do I get these commands?

Jerry
----------------------
help shows:
help
! Execute a shell command
abort halt Cancel a running halt
ael debug contexts Enable AEL contexts debug (does nothing)
ael debug macros Enable AEL macros debug (does nothing)
ael debug read Enable AEL read debug (does nothing)
ael debug tokens Enable AEL tokens debug (does nothing)
ael nodebug Disable AEL debug messages
ael reload Reload AEL configuration
agent logoff Sets an agent offline
agent show Show status of agents
agent show online Show all online agents
agi debug Enable AGI debugging
agi debug off Disable AGI debugging
agi dumphtml Dumps a list of agi commands in html format
agi show List AGI commands or specific help
cdr status Display the CDR status
console answer Answer an incoming console call
console autoanswer Sets/displays autoanswer
console dial Dial an extension on the console
console hangup Hangup a call on the console
console send text Send text to the remote device
core clear profile Clear profiling info
core set debug channel Enable/disable debugging on a channel
core set debug Set level of debug chattiness
core set debug off Turns off debug chattiness
core set global Set global dialplan variable
core set verbose Set level of verboseness
core show applications Shows registered dialplan applications
core show application Describe a specific dialplan application
core show audio codecs Displays a list of audio codecs
core show channels Display information on channels
core show channel Display information on a specific channel
core show channeltypes List available channel types
core show channeltype Give more details on that channel type
core show codecs Displays a list of codecs
core show codec Shows a specific codec
core show config mappings Display config mappings (file names to config engines)
core show file formats Displays file formats
core show file version List versions of files used to build Asterisk
core show functions Shows registered dialplan functions
core show function Describe a specific dialplan function
core show globals Show global dialplan variables
core show hints Show dialplan hints
core show image codecs Displays a list of image codecs
core show image formats Displays image formats
core show license Show the license(s) for this copy of Asterisk
core show profile Display profiling info
core show switches Show alternative switches
core show threads Show running threads
core show translation Display translation matrix
core show uptime Show uptime information
core show version Display version info
core show video codecs Displays a list of video codecs
core show warranty Show the warranty (if any) for this copy of Asterisk
database del Removes database key/value
database deltree Removes database keytree/values
database get Gets database value
database put Adds/updates database value
database show Shows database contents
database showkey Shows database contents
dialplan add extension Add new extension into context
dialplan add ignorepat Add new ignore pattern
dialplan add include Include context in other context
dialplan reload Reload extensions and * only * extensions
dialplan remove extension Remove a specified extension
dialplan remove ignorepat Remove ignore pattern from context
dialplan remove include Remove a specified include from context
dialplan save Save dialplan
dialplan show Show dialplan
dnsmgr reload Reloads the DNS manager configuration
dnsmgr status Display the DNS manager status
dundi debug Enable DUNDi debugging
dundi flush Flush DUNDi cache
dundi lookup Lookup a number in DUNDi
dundi no debug Disable DUNDi debugging
dundi no store history Disable DUNDi historic records
dundi precache Precache a number in DUNDi
dundi query Query a DUNDi EID
dundi show entityid Display Global Entity ID
dundi show mappings Show DUNDi mappings
dundi show peers Show defined DUNDi peers
dundi show peer Show info on a specific DUNDi peer
dundi show precache Show DUNDi precache
dundi show requests Show DUNDi requests
dundi show trans Show active DUNDi transactions
dundi store history Enable DUNDi historic records
feature show Lists configured features
file convert Convert audio file
group show channels Display active channels with group(s)
help Display help list, or specific help on a command
http show status Display HTTP server status
iax2 provision Provision an IAX device
iax2 prune realtime Prune a cached realtime lookup
iax2 reload Reload IAX configuration
iax2 set debug Enable IAX debugging
iax2 set debug jb Enable IAX jitterbuffer debugging
iax2 set debug jb off Disable IAX jitterbuffer debugging
iax2 set debug off Disable IAX debugging
iax2 set debug trunk Enable IAX trunk debugging
iax2 set debug trunk off Disable IAX trunk debugging
iax2 show cache Display IAX cached dialplan
iax2 show channels List active IAX channels
iax2 show firmware List available IAX firmwares
iax2 show netstats List active IAX channel netstats
iax2 show peers List defined IAX peers
iax2 show peer Show details on specific IAX peer
iax2 show provisioning Display iax provisioning
iax2 show registry Display IAX registration status
iax2 show stats Display IAX statistics
iax2 show threads Display IAX helper thread info
iax2 show users List defined IAX users
iax2 test losspct Set IAX2 incoming frame loss percentage
indication add Add the given indication to the country
indication remove Remove the given indication from the country
indication show Display a list of all countries/indications
keys init Initialize RSA key passcodes
keys show Displays RSA key information
local show channels List status of local channels
logger mute Toggle logging output to a console
logger reload Reopens the log files
logger rotate Rotates and reopens the log files
logger show channels List configured log channels
manager show command Show a manager interface command
manager show commands List manager interface commands
manager show connected List connected manager interface users
manager show eventq List manager interface queued events
manager show users List configured manager users
manager show user Display information on a specific manager user
meetme Execute a command on a conference or conferee
mgcp audit endpoint Audit specified MGCP endpoint
mgcp reload Reload MGCP configuration
mgcp set debug Enable MGCP debugging
mgcp set debug off Disable MGCP debugging
mgcp show endpoints List defined MGCP endpoints
mixmonitor Execute a MixMonitor command.
module load Load a module by name
module reload Reload configuration
module show List modules and info
module show like List modules and info
module unload Unload a module by name
moh reload Music On Hold
moh show classes List MOH classes
moh show files List MOH file-based classes
no debug channel originate Originate a call
queue add member Add a channel to a specified queue
queue remove member Removes a channel from a specified queue
queue show Show status of a specified queue
realtime load Used to print out RealTime variables.
realtime update Used to update RealTime variables.
restart gracefully Restart Asterisk gracefully
restart now Restart Asterisk immediately
restart when convenient Restart Asterisk at empty call volume
rtcp debug ip Enable RTCP debugging on IP
rtcp debug Enable RTCP debugging
rtcp debug off Disable RTCP debugging
rtcp stats Enable RTCP stats
rtcp stats off Disable RTCP stats
rtp debug ip Enable RTP debugging on IP
rtp debug Enable RTP debugging
rtp debug off Disable RTP debugging
say load set/show the say mode
show parkedcalls Lists parked calls
show queues sip history Enable SIP history
sip history off Disable SIP history
sip notify Send a notify packet to a SIP peer
sip prune realtime Prune cached Realtime object(s)
sip prune realtime peer Prune cached Realtime peer(s)
sip prune realtime user Prune cached Realtime user(s)
sip reload Reload SIP configuration
sip set debug Enable SIP debugging
sip set debug ip Enable SIP debugging on IP
sip set debug off Disable SIP debugging
sip set debug peer Enable SIP debugging on Peername
sip show channels List active SIP channels
sip show channel Show detailed SIP channel info
sip show domains List our local SIP domains.
sip show history Show SIP dialog history
sip show inuse List all inuse/limits
sip show objects List all SIP object allocations
sip show peers List defined SIP peers
sip show peer Show details on specific SIP peer
sip show registry List SIP registration status
sip show settings Show SIP global settings
sip show subscriptions List active SIP subscriptions
sip show users List defined SIP users
sip show user Show details on specific SIP user
skinny reset Reset Skinny device(s)
skinny set debug Enable Skinny debugging
skinny set debug off Disable Skinny debugging
skinny show devices List defined Skinny devices
skinny show lines List defined Skinny lines per device
sla show stations Show SLA Stations
sla show trunks Show SLA Trunks
soft hangup Request a hangup on a given channel
stop gracefully Gracefully shut down Asterisk
stop now Shut down Asterisk immediately
stop when convenient Shut down Asterisk at empty call volume
stun debug Enable STUN debugging
stun debug off Disable STUN debugging
transcoder show Display Zaptel transcoder utilization.
udptl debug Enable UDPTL debugging
udptl debug ip Enable UDPTL debugging on IP
udptl debug off Disable UDPTL debugging
voicemail show users List defined voicemail boxes
voicemail show zones List zone message f

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
stotaro at totarotechn...
Guest





PostPosted: Sun Apr 13, 2008 5:05 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

This is great stuff, thanks.

Steve Totaro

On Sat, Apr 12, 2008 at 9:27 PM, Jonathan C. Bailey
<jbailey at co.marshall.ia.us> wrote:
Quote:
We use Nagios for network monitoring. We've got a check_pri script that should be fairly universal. It will return "critical" for any alarm. Feel free to use the script as you see fit. YMMV - may skin cats, etc (you know the disclaimer drill)...


#! /usr/bin/python

# Checks PRI status - returns similar to the following:
# PRI span 1/0: Provisioned, Up, Active / PRI span 2/0: Provisioned, Up, Active


import os, sys, socket

statusstring = ''

for file in os.popen('/usr/sbin/asterisk -rx "pri show spans"').readlines():
out = file[:-1]
if out.startswith('PRI'):
statusstring += ' / ' + out.strip()
if out.startswith('Unable to connect to remote asterisk'):
print "Unable to connect to Asterisk instance"
sys.exit(2)

print statusstring.strip()[2:]

if statusstring.strip()[2:].count("In Alarm") > 0:
sys.exit(2)

# Nagios Return Codes
# OK = 0
# Warning = 1
# Critical = 2
# Unknown = 3

sys.exit(0)



-Jon



----- Original Message -----
From: "Alex Balashov" <abalashov at evaristesys.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Sent: Saturday, April 12, 2008 8:21:09 PM GMT -06:00 US/Canada Central
Subject: Re: [asterisk-users] way to inquire status of T1 link

Jerry Geis wrote:
Quote:
Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

What sort of adaptor?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
jra at baylink.com
Guest





PostPosted: Sun Apr 13, 2008 5:20 pm    Post subject: [asterisk-users] way to inquire status of T1 link Reply with quote

On Sat, Apr 12, 2008 at 08:38:00PM -0400, Jerry Geis wrote:
Quote:
Is there a way to inquire of the T1 link status?

I mean having cron (as example) execute a program that asks if the T1
status is OK.YEL or RED?
then on RED I can send some alert?

Since Sangomas were original designed as unchannelized data cards,
ifconfig exposes the alarm state; alarmed spans don't show "RUNNING",
while green ones do. I don't think you can distinguish between YEL and
RED, but you probably don't need to.

I gather you can also SNMP the Sangoma drivers.

Cheers,
-- jra
--
Jay R. Ashworth Baylink jra at baylink.com
Designer The Things I Think RFC 2100
Ashworth & Associates http://baylink.pitas.com '87 e24
St Petersburg FL USA http://photo.imageinc.us +1 727 647 1274

Those who cast the vote decide nothing.
Those who count the vote decide everything.
-- (Joseph Stalin)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services