Convergence

Bringing IT to a point …

Convergence header image 2

Monitoring Wanpipe and chan_ss7 with Nagios

February 22nd, 2010 · 1 Comment

As Barry O’Donovan said “… have a number of Asterisk implementations that I keep an eye on that have multiple PRI connections. Knowing if and when they ever go down has the obvious benefits of alerting me to a problem in near real time. But besides that, it allows my customers and I to verify SLAs, track and log issues, etc …”

… in our case they aren’t ISDN PRI, rather SS7 E1 and the number is now running into the hundreds, and we’re averse to PHP :)

So, we made a couple of simple python based nagios plugins to check for E1 status and for chan_ss7 link status.

First download and install pynag. This makes life super easy.

Then download these three files check_ss7.py & check_wanpipe.py & check_cic.py into /usr/lib/nagios/plugins. Please edit as necessary. Report any bugs please.

Lastly, 3 configuration changes in Nagios:

1: /etc/nagios/command-plugins.cfg:

# Python checks
command[check_wanpipe]=/usr/lib/nagios/plugins/check_wanpipe.py -w 1 -c 2 -H $HOSTADDRESS$
command[check_ss7]=/usr/lib/nagios/plugins/check_ss7.py -w 1 -c 2 -H $HOSTADDRESS$
command[check_cic]=/usr/lib/nagios/plugins/check_cic.py -w 1 -c 2 -H $HOSTADDRESS$

2: /etc/nagios/objects/commands.cfg:

define command {
        command_line                    $USER1$/check_wanpipe.py -w 1 -c 2 -H $HOSTADDRESS$
        command_name                    check_wanpipe
}

define command {
        command_line                    $USER1$/check_ss7.py -w 1 -c 2 -H $HOSTADDRESS$
        command_name                    check_ss7
}

define command {
        command_line                    $USER1$/check_cic.py -w 1 -c 2 -H $HOSTADDRESS$
        command_name                    check_cic
}

3: /etc/nagios/objects/localhost.cfg:

define service {
         use                            local-service
         service_description            WANPIPE1
         check_command                  check_wanpipe
         host_name                      localhost
}

define service {
         use                            local-service
         service_description            SS7
         check_command                  check_ss7
         host_name                      localhost
}

define service {
         use                            local-service
         service_description            CIC
         check_command                  check_cic
         host_name                      localhost
}

That’s it … restart nagios, and you should have alarms for wanpipe, ss7 link alignment and cic status, not to mention a total count of calls in|out … voila!

Nagios Alarms

Nagios Alarms

Tags: Asterisk · Sangoma · SS7

1 response so far ↓

  • 1 wasim // Mar 10, 2010 at 8:20 am

    oh, for those of you using libss7, apply this patch

    28c28
    < linkset = "1"
    ---
    > linkset = “ptcl”
    36c36
    < line = os.popen("%s -rnx 'ss7 show linkset %s'" % (cmd,linkset)).readline()
    ---
    > line = os.popen(“%s -rnx ‘ss7 link status’” % cmd).readline()
    38c38
    < if "Down" in line :
    ---
    > if “NOT_ALIGNED” in line :
    40c40,42
    < elif "Up" in line :
    ---
    > elif “PROVING” in line :
    > np.nagios_exit(“WARNING”, “link %s PROVING” % linkset)
    > elif “INSERVICE” in line :

    I’ll write something up for the dahdi monitoring as well …

You must log in to post a comment.