disable port using nagios core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: disable port using nagios core

Post by DOkuwa »

Yes i know i need to modify the scripts check_alcatel_ports.pl to ignore the administrative down message for that particular interface or maybe oid
This is what i am trying to figure out

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: disable port using nagios core

Post by tmcdonald »

We do offer custom development, and if that is a service you are interested in I can start that process for you so we can get a quote generated.
Former Nagios employee
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: disable port using nagios core

Post by DOkuwa »

any ideas for this logic
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: disable port using nagios core

Post by mcapra »

DOkuwa wrote:I have the snmp oid which relates to the desired port on the alcatel devices that needs to be filtered out and don't know if this can be adjusted in the script
L#186-L#219 is where I suspect the change would need to be made.

Code: Select all

foreach my $port (sort keys %ports) {

    my $name = $ports{$port}->[0];
    my $desc = $ports{$port}->[4];
    my $mode = $ports{$port}->[1];
    my $admin = $ports{$port}->[2];
    my $oper = $ports{$port}->[3];
        my $port_state = $ports{$port}->[5];


# Skip if not network port
    if ($mode != 2) {
        next;
    }

# Skip if admin down
    elsif ($admin == 3) {
        next;
    }

# Skip if state is 'ghost' (port provisioned by not physically present)
    elsif ($port_state == 2){
        next;
        }

# Alarm if oper down
    elsif ($oper != 2) {
        $error = 1;
        $state = $ERRORS{'CRITICAL'};
        $answer .= "[$desc OperStatus down] ";
        next;
    }

}
Essentially adding a # Skip if oid.to.ignore section in the elsif chain. Though without knowing exactly what is being matched (probably $name or $desc) and to what value, I can't say for certain what the exact change should be.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: disable port using nagios core

Post by kyang »

Thanks @mcapra!
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: disable port using nagios core

Post by DOkuwa »

Thanks
it has been sorted
just needed to add some modification to the check_alcatel_ports scripts
e.g if $name = "A/4 ")
next;
This skips any interface with name of A/4 which is the interface to be ignored
kyang

Re: disable port using nagios core

Post by kyang »

Sounds good! Are there any more questions or can we close this thread?
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: disable port using nagios core

Post by DOkuwa »

please close this thread but expecting answers from my other threads
very big thanks you
kyang

Re: disable port using nagios core

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked