Skip to content

SIP registration check seems not to work #4

@JanRSimon

Description

@JanRSimon

Dear Nico,

first thanks a lot for this script!

I've tried your script on an old Elastix 2.0.3 and 2.2. (x86, Perl 5.8.0.8) The SIP registry check seems to be not working as expected for me. But peers and others do.

On my boxes the refresh times varying from 105 so I cut it out to have the following code lines.

} elsif ($asterisk_command_tag eq "registry") {

foreach (`$asterisk_bin $asterisk_option \"$asterisk_command\"`) {

    if (/Username/) {
        next;
    }
    if (/registrations./) {
        next;
    }
    if (!/Registered/) {
        $return = $STA_CRITICAL;
        $output = "Trunk NOT OK";
        next;
    }
    $return = $STA_OK;
    $output = "Trunk OK\n";
}    

From my understanding the nagisk script initiates the sip show registry command, catches the output and compares line by line.
If it finds "Username" it goes to the next line (found in the first line)
If it finds "registrations." it goes to the next line (found in the last line)
If it doesn't find "Registered" it should output Trunk NOT OK.

When I run the script it always keep saying Trunk NOT OK even all trunks show up when I check it myself (sip show registry).

Do I misunderstand the script and forgot to change other parameters or did I stumble upon a bug?

Thanks a lot!
Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions