Fibre Channel (SAN)

Reply
Contributor
Posts: 21
Registered: ‎02-20-2015

Script to check snmp.trapEnterpriseFlag?

Hello All,

 

 Do anyone know about the script which will pull up the information of "snmp.trapEnterpriseFlag" parameter like is it set to 1 or to 0. We have more than 80 Switch in our environment. So it is little time consuming to go to each switch individually and check this parameter.

 

Moreover do anyone also have script with the help of which we can change the parameter of "snmp.trapEnterpriseFlag" either from 0 to 1 or vice versa.

Frequent Contributor
Posts: 107
Registered: ‎04-05-2011

Re: Script to check snmp.trapEnterpriseFlag?

Hello!

 

if you the command you need to issue in the switch:

 

Quick and dirty solution:

 - get the plink.exe (it comes with putty)

 

run this way: plink.exe -pw <switchpassword> <user>@<ipaddress> "foscommand"

 

this will connect to the switch, runs the command and show the result in the stdout.

 

 

A more elegant solution

 - Use python and paramiko to connect to the switches and run the commands

 

import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.load_system_host_keys()


client.connect(strHost,username='switchuser',password='switchpassword')
stdin, stdout, stderr = objClient.exec_command(txtComando)
while not stdout.channel.exit_status_ready():
    stdin.close()
    print stdout.read().splitlines()

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.