Unsolved
This post is more than 5 years old
20 Posts
0
8557
ASL script question
Hi,
I would like to make multiple queries for data using ASL and was wondering how I do this ASL.
Example:
I would like to extract all routers and then all cards associtaed with each of the routers.
Thanks in advance
James
I would like to make multiple queries for data using ASL and was wondering how I do this ASL.
Example:
I would like to extract all routers and then all cards associtaed with each of the routers.
Thanks in advance
James
Hemulll
138 Posts
0
September 16th, 2009 03:00
Example of asl script:
START {
.. eol
}
do {
foreach router (getInstances("Router")) {
routerObj = object(router);
print("Router : ".routerObj->Name);
cardObj = routerObj->getCards();
if (!cardObj->isNull()) {
print("Card : ".cardObj->Name);
}
}
}
Hemulll
138 Posts
0
September 16th, 2009 04:00
Fixed Code:
START {
.. eol
}
do {
foreach router (getInstances("Router")) {
routerObj = object(router);
if (!routerObj->isNull()) {
print("Router : ".routerObj->Name);
cardList = list();
cardList = routerObj->getCards();
foreach card (cardList) {
cardObj = object(card);
if (!cardObj->isNull()) {
print("Card : ".cardObj->Name);
}
}
}
}
}
Hemulll
138 Posts
0
September 16th, 2009 04:00
Only a few points of happiness on this forum
Do u have ICQ, Skype etc ... ???
savuka1
20 Posts
0
September 16th, 2009 04:00
Thanks, worked like a charm
How much do I owe you
James
savuka1
20 Posts
0
September 16th, 2009 04:00
I get the floowing error
ASL-ERROR_OBJECT-Tried to perform a repository operation on a non-object
I think it is todo with some routers not haveing cards, but looking at the code you would think that the if statement should handle that.
Any ideas
Kind Regards
James
savuka1
20 Posts
0
September 16th, 2009 05:00
Hi Hemul,
Only skype at home , not allow to use it at work
username is welljam
my email address is james.wells@zxxx.com
I have added a few more checks to the code.
####################################
START {
.. eol
}
do {
foreach router (getInstances("Router"))
{
routerObj = object(router);
if (!routerObj->isNull())
{
RouterStatus = (routerObj->IsUnmanagedOrUnresponsive);
if ( RouterStatus != FALSE )
{
print("Router : ".routerObj->Name." IsUnManaged : ".routerObj->IsUnmanagedOrUnresponsive);
}
cardList = list();
cardList = routerObj->getCards();
foreach card (cardList)
{
cardObj = object(card);
if (!cardObj->isNull())
{
Cardstatus = (cardObj->Status);
if ( Cardstatus != "OK" )
{
print("Card : ".cardObj->Name." Status : ".cardObj->Status);
}
}
}
}
}
stop();
}
####################################
I had another question, is it possible to go through a list like routers and switches and not just routers and I also used a stop(); in my code , is this nessasary ?
Kind Regards
James
Hemulll
138 Posts
0
September 16th, 2009 06:00
Sure, you should use ICIM_UnitaryCumputerSystem insted router class, for example:
Hemulll
138 Posts
0
September 16th, 2009 06:00
Sure, you should use ICIM_UnitaryCumputerSystem insted router class, for example:
Why do you need stop action ?
Hemulll
138 Posts
0
September 16th, 2009 07:00
rapid writing always leads to the inevitable errors
No time for debug
Message was edited by:
Hemul
savuka1
20 Posts
0
September 16th, 2009 07:00
The words Router and Switch for devObj->Type must be in uppercase it would seem as SMARTS ASL is case sensitive.
Kind Regards
James
savuka1
20 Posts
0
September 16th, 2009 07:00
Not sure, why do you use a stop statement in ASL, is there a valid purpose, its just I have seen it used on the EMC support site in some examples.
Kind Regards
James
savuka1
20 Posts
0
September 16th, 2009 08:00
Thanks again for all your help, maybe one day I will be able to repay the favour.
Kind Regards
James
Hemulll
138 Posts
0
September 29th, 2009 08:00
towczaruk
12 Posts
0
January 14th, 2010 03:00
Hi. I have similar problem, maybe do you know how to extract data from another instance. I running ASL script under Smarts Open Integration Server, and I want to extract some data from Availability and Performance Manager. In perl it's very simple, but I don't know how to create (open) session to this domain.
I try to look into ics-topology-sync.asl which synchronizes topology of the InCharge server with underlying Domains, but it's to hard :/
Thanks in advance
Tomasz
FredericMeunier_0588be
143 Posts
0
January 14th, 2010 08:00
Hi Tomasz,
what do you want to do exactly ? If you want to sync. some attributes from IP to OI, and you already have OI subscribing to IP, you can configure the DXA to do so. We need more details to figure out what is the solution which can answer your needs.
--Fred
== Monitor your Smarts environment using APG ReportPack for Smarts health ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com