- Community Home
- >
- Storage
- >
- Midrange and Enterprise Storage
- >
- HPE EVA Storage
- >
- Re: Brocade Scripting of commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 01:09 AM
тАО03-08-2010 01:09 AM
Any way by means of which I can trigger executing my set of commands and try sending any alerts(warnings or errors on each switch) noted to my email Id.
Cheers,
BMK
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2010 04:02 AM
тАО03-08-2010 04:02 AM
Re: Brocade Scripting of commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2010 06:52 AM
тАО03-09-2010 06:52 AM
Re: Brocade Scripting of commands
can you pls give me an example if possible?
Kites
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2010 01:08 PM
тАО03-09-2010 01:08 PM
Re: Brocade Scripting of commands
There are some Fabric management software that should be able to do that.
-Thank You
Bharath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 12:15 AM
тАО03-10-2010 12:15 AM
Re: Brocade Scripting of commands
1) Switch-side scripting: it can be done with expect
2) Alerts: you can get them via snmp.
1) Your expect script can look like this one (a have no brocade by hand for test but i'm pretty sure that it will work):
#!/usr/bin/expect -f
spawn ssh 1.2.3.4 -l admin
log_user 1
match_max 100000
expect "?*login*"
send -- "admin\r"
expect "password:"
send -- "password\r"
send -- "\r"
send -- "switchshow\r"
expect eof
This script will show you output of switchshow command then you can parse it by grep, for example. If you don't want to have a headache with expect, i recommend you to use autoexpect (http://expect.nist.gov/doc/autoexpect.pdf) - it "records" your activity and writes a script by itself, so you can just put in in crontab.
2) As for snmp - it's quite simple, you should just find OID in Brocade's MIB (you can download it from switches support page) and configure snmptrapd.conf to receive traps from switch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2010 03:57 AM
тАО03-31-2010 03:57 AM
Re: Brocade Scripting of commands
Sorry for this late reply.
We have connectivity to switches by ssh and snmp already configured.
I want to know how do I have to schedule connectivity to these switches and send the o/p of commands to my email id.
Cheers,
Kites BM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2010 04:06 AM
тАО03-31-2010 04:06 AM
Re: Brocade Scripting of commands
1) write script using expect (or autoexpect)
2) write another script which executes first one, redirects it's output to temporary file and mails it (it will look like this: cat output_file.log | mail -s 'Subject' mail@domain.com)
3) edit crontab file (depending you unix\linux version syntax may me little different, but "man cron" helps you) and place there your second script there
Well... At least, this way is simple :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2010 04:13 AM
тАО03-31-2010 04:13 AM
Re: Brocade Scripting of commands
Thanks,
I would really love to follow those 3 steps above,but its on win OS that we have ssh (putty)connectivity to those switches.
Any way to get it done on Win OS??
Kites
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2010 04:23 AM
тАО03-31-2010 04:23 AM
Re: Brocade Scripting of commands
Well... There's at least two ways to upgrade this three steps with step 0)
- install cygwin (http://www.cygwin.com/) on your windows PC.
- use coLinux (http://www.colinux.org/)
Actually, both this ways are little pervert and in theory you can try to use WSH, but in this case i cannot give you any advise as i have nearly no experience with it and i'm not sure that putty can redirect it's output. Anyway, you can at least look at WSH (http://msdn.microsoft.com/en-us/library/9bbdkx3k%28VS.85%29.aspx) until you'll begin to do something with cygwin or colinux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2010 03:12 AM
тАО04-30-2010 03:12 AM
Re: Brocade Scripting of commands
Well, sorry for the late reply.
further to make it happen I tried my bit of efforts ( didn't find time for this long)
>I installed putty.exe on windows server
>I created batch file and scheduled it to run daily at once
The contents of the batch file are
" putty.exe -ssh -v username@hostname -pw
>I put my set of switch-commands to be run in commands.dat file on location D:
All is well ....I now want to well organize and capture the output of each command. Send this collected output to a file on D:
Any comments on how I can do this?
Of course, the batch file contents shows the login password - which I believe can be encrypted.
Thanks,
Kites
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2010 04:11 AM
тАО04-30-2010 04:11 AM
Solutionyou could create a Putty Session, saving the IP-Address of the switch and the File name for logging.
If you have a look at the logging options in Putty, you can use characters to specify the date, time and hostname.
e.g. set the log file to D:\logs\&Y&M&D_&H.txt
That would create a logfile in D:\logs called (for today on host "switch1") 20100430_switch1.txt
Then call Putty via command line:
putty.exe -load "session-name" and include your other parameters
Hope that helps
Regards,
Stephen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2010 04:59 AM
тАО04-30-2010 04:59 AM
Re: Brocade Scripting of commands
Thanks,
This works.
The output of the file appears in unordered fashion. I wanted to make it look pretty as shown on cmd prompt of the switch.
also I want to put breaks( introduce new lines) between any 2 commands so that the output captured is seen neatly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2010 05:56 AM
тАО04-30-2010 05:56 AM
Re: Brocade Scripting of commands
Printable output or All session output.
I use "All session output", and it comes out fine, with tabs and everything.
Not sure about the line breaks, though.
Regards,
Stephen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2010 03:44 AM
тАО05-04-2010 03:44 AM