06-18-2015 05:03 AM
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.
06-24-2015 04:02 AM
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.AutoAd
dPolicy()) client.load_system_host_keys() client.connect(strHost,username='switchuser',passw ord='switchpassword') stdin, stdout, stderr = objClient.exec_command(txtComando) while not stdout.channel.exit_status_ready(): stdin.close() print stdout.read().splitlines()