[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]

 

     [nocol-users] SNMP Port option

Hey Guys,

I noticed that the snmpgeneric monitor doesn't understand that you might
have your snmpagent on another port (unlikely, I know.. but I do on some of
my machines)

I have written the attached patch so that you can add a :<portnum> onto the
IP in the config file for snmpgeneric to do so.

Cheers.

 -- joe.

131c131
<   
---
> 
133d132
<   
138c137,142
<   
---
> 
>   #
>   # See if there is a port number
>   #
>   ($router, $port) = split(/:/, $router, 2);
> 
141c145
<   
---
> 
146c150
<   
---
> 
151c155
<     
---
> 
154,155c158,164
<     
<     $cmd = "$snmpwalk $router $community{$item} $myoid";
---
> 
>     if ($port) {
>       $cmd = "$snmpwalk -P $port $router $community{$item} $myoid";
>     } else {
>       $cmd = "$snmpwalk $router $community{$item} $myoid";
>     }
> 
174c183
<       
---
> 
177c186
<     
---
> 
185c194,200
<       $cmd = "$snmpget $router $community{$item} $oid{$item}";
---
> 
>       if ($port) {
> 	$cmd = "$snmpget -p $port $router $community{$item} $oid{$item}";
>       } else {
> 	$cmd = "$snmpget $router $community{$item} $oid{$item}";
>       }
> 
195c210
<     
---
> 
203c218
<     
---
>