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

2008-04-13 Thread linuxian iandsd
with digium cards i would use:

#sudo asterisk -r

once inside cli :

dialer1*CLI zap show status
 Description Alarms IRQbpviol
 C4
 T2XXP (PCI) Card 0 Span 1 RED0
 0
 T2XXP (PCI) Card 0 Span 2 RED0
 0
 dialer1*CLI


so RED is an ALARM
GREEN is OK

here this is a digium card woth 2 pri interfaces  i have unpluged them so
you see the RED alarm
___
-- 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

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

2008-04-13 Thread Tim H. Panton
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 [EMAIL PROTECTED]
To: asterisk-users@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


___
-- 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


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

2008-04-13 Thread Jerry Geis

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  

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

2008-04-13 Thread Tzafrir Cohen
On Sat, Apr 12, 2008 at 08:38:00PM -0400, Jerry Geis wrote:
 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:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]
http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir

___
-- 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


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

2008-04-13 Thread Jonathan C. Bailey
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 [EMAIL PROTECTED]
To: asterisk-users@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

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

2008-04-13 Thread Steve Totaro
This is great stuff, thanks.

Steve Totaro

On Sat, Apr 12, 2008 at 9:27 PM, Jonathan C. Bailey
[EMAIL PROTECTED] wrote:
 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 [EMAIL PROTECTED]
  To: Asterisk Users Mailing List - Non-Commercial Discussion 
 asterisk-users@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:
   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


___
-- 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


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

2008-04-13 Thread Jay R. Ashworth
On Sat, Apr 12, 2008 at 08:38:00PM -0400, Jerry Geis wrote:
 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  [EMAIL PROTECTED]
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)

___
-- 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


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

2008-04-12 Thread Jerry Geis
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

___
-- 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


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

2008-04-12 Thread Jon Pounder
Quoting Jerry Geis [EMAIL PROTECTED]:

 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.


 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



___
-- 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


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

2008-04-12 Thread Alex Balashov
Jerry Geis wrote:
 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


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

2008-04-12 Thread Jonathan C. Bailey
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 [EMAIL PROTECTED]
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@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:
 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