[Asterisk-Users] Querying Nagios users...

Jeremy Melanson jeremy at PreferredTime.com
Thu Jul 28 10:56:05 MST 2005


Hi Mike.

The attached .tar.gz file contains the Perl script. It requires utils.pm
(part of the "nagios-plugins" package). In my case, the file is in
"/usr/lib/nagios/plugins". You may need to modify the "use lib" entry in
the script if yours is in a different location. I also recommend that
the script be installed in the same directory, but it is not necessary.

You can get a list of options by typing 'check_ast-cmd -h' from your
shell.

Some caveats:

Currently, all the script does is allow you to issue a command, and
check the output of the Manager Interface against a specified Perl
Regular Expression. It will only tell you if it matches or not. 

While you can define the password from the command line (using -P), it
is recommended that you modify the default in the script. Any passwords
called from the command line in using Nagios can be accessed from the
web interface in clear text.

* I'd love to hear from you if you have any suggestions on how to use
this script to test other parts of Asterisk.

Nagios command examples...
If you're reasonably familiar with Nagios, you can probably skip the
info below.

Check the status of PRI:

define command {
  command_name check_ast-pri
  command_line /usr/lib/nagios/plugins/check_ast-cmd -H $HOSTADDRESS$ -n
"AST_PRI" -c "pri show span 1" -e "Status: Provisioned, Up, Active" -g
"PRI Operational" -E "Problem with PRI" -v
}

define service {
  name ast-pri-options
  service_description ASTERISK-PRI
  is_volatile 0
  max_check_attempts 3
  normal_check_interval 5
  retry_check_interval 1
  register 0
  check_command check_ast-pri
  active_checks_enabled 1
  passive_checks_enabled 0
  parallelize_check 1
  obsess_over_service 1
  check_freshness 0
  notifications_enabled 0
  event_handler_enabled 0
  flap_detection_enabled 0
  process_perf_data 1
  retain_status_information 1
  retain_nonstatus_information 1
  check_period 24x7
  host_name [ASTERISK_HOSTNAME] ; Change this value to your Asterisk
machine's host_name (as defined in hosts.cfg).
  contact_groups [CONTACT_GROUP] ; Change the value to a valid
contactgroup (as defined in contactgroups.cfg).
  notification_interval 240
  notification_period 24x7
  notification_options c,r
}


On Thu, 2005-07-28 at 12:24 -0400, Mike Clark wrote:
> I am interested. We have just started using Nagios, so this could be a 
> nice add-on.
> 
> Mike Clark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_ast-cmd.tar.gz
Type: application/x-compressed-tar
Size: 3106 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050728/dadc31bd/check_ast-cmd.tar.bin


More information about the asterisk-users mailing list