Hi Leonardo,
It's relatively easy once you know the attributes you want. See below
sample of getting switch/router info sent in email in delimited text.
--script-
echo "Serial number,manufacture,model name,ip address,mac address,device
type,last poll" > TEMP
../show devices | egrep -i "Hub|Sw|Cisco|Nortel|3Com" | grep -v <var> |
grep 0x | awk '{print $1}' | \
while read line; do \
../show attributes attr=0x10030 attr=0x10032 attr=0x1006e
attr=0x1027f attr=0x110df attr=0x23000e attr=0x11620 mh=$line | awk
'{print $3}' | tr "\n" "," | sed 's/Iid,//g' ; echo "" ;
done >> TEMP
mail -h <mailrelay> -s "Switch Asset info" [email protected] < TEMP
rm TEMP
--/script-
M
________________________________
From: Leonardo H. Machado [mailto:[email protected]]
Sent: 27 August 2009 11:05 PM
To: spectrum
Subject: [spectrum] Report generation via Command line
Is it possible to creat a report exported as CSV using a command line
utility?
Everyday, I have to open Onclick, select Universe, filter the IPs I need
and export the list as CSV to a file.
If I could do it using the command line, things would be much easier for
me.
Is it possible?
--
Leonardo Henrique Machado
---
To unsubscribe from spectrum, send email to [email protected] with the body:
unsubscribe spectrum [email protected]
RE: [spectrum] Report generation via Command line
Marius Cornelissen - Business Connexion Thu, 27 Aug 2009 23:48:39 -0700
- [spectrum] Report generation via C... Leonardo H. Machado
- Re: [spectrum] Report generat... Calvin Lane
- RE: [spectrum] Report generat... Marius Cornelissen - Business Connexion
