I am pulling out the Description via ASL and want to only print data using comma's as the FS.
How do a go about doing this, I have tried substring but it is not working as expects, I am looking for an awk type print statement
example:
awk -F"," {print $1" "$2}'
ASL code I am using:
START {
}
do {
// get list of all nodes
//
nodes = getInstances("ICIM_UnitaryComputerSystem");
//
// go through list of nodes
//
foreach node ( nodes ) {
or = object(node);
de = or->DiscoveryErrorInfo?IGNORE;
model = or->Model?IGNORE;
desc = or->Description?IGNORE;
newdesc = substring(desc,33,43);
if ( glob( 'SWFE-E-ELOOP-Agent*', de) ) {
print(node." ".model." ".newdesc);
}
}
//
stop();
//
}
Hi, START { } do { // get list of all nodes // nodes = getInstances("ICIM_UnitaryComputerSystem"); // // go through list of nodes // foreach node ( nodes ) { or = object(node); de = or->DiscoveryErrorInfo?IGNORE; model = or->Model?IGNORE; desc = or->Description?IGNORE;
Hi, START { } do { // get list of all nodes // nodes = getInstances("ICIM_UnitaryComputerSystem"); // // go through list of nodes // foreach node ( nodes ) { or = object(node); de = or->DiscoveryErrorInfo?IGNORE; model = or->Model?IGNORE; desc = or->Description?IGNORE;
How do you call this function as I have tried that code and have searched the ASL scripting guide and cannot find an example of how to call that function on a list of devices.
My goal is also to get the severity of the Cisco syslogs that extracts betwwen the "-" in any order. DO you have a sample hook script and syslog mgr asl that i can look at? thanks
savuka1
20 Posts
458
0
Posted June 4th, 2009 06:00
RAW Data:
test.uk.com 2801 Cisco IOS Software, 2800 Software (C2800NM-IPBASEK9-M), Version 12.4(8c), RELEASE SOFTWARE (fc3)\X0D\X0ATechnical Support: http://www.cisco.com/techsupport\X0D\X0ACopyright (c) 1986-2006 by Cisco Systems, Inc.\X0D\X0ACompiled Mon 11-Dec-06 22:06 by prod_rel_team
Required format:
test.uk.com 2801 Version 12.4(8c)
So I want to split the 3 data field using comma's so I only print out the version of IOS.
Kind Regards
J