This post is more than 5 years old
9 Posts
0
1082
September 7th, 2011 07:00
How do I set the RealizedBy attribute of a Port using ASL?
Hi,
I am trying to use an ASL script to create the RealizedBy Relationship between Ports and Cards.
I can achieve this manually using the following dmctl command:
dmctl -s put Port:: ::RealizedBy Card::
Looking at other asl scripts in the $IP/rules/directory I see that the format to achieve this using ASL is
portObj->RealizedBy = cardObj
I have tried setting the portObj and cardObj variables to be as listed below:
MR_OBJECT:: , Port:: ,
MR_OBJECT:: , Card:: ,
Below is a simple script that I am using to test the functionality:
START {
REALISE | eol
}
REALISE {
} do {
cardObj="CARD-10.2.0.178/NIF-3";
portObj="PORT-10.2.0.178/212";
print("Card Object = ".cardObj);
print("Port Object = ".portObj);
portObj->RealizedBy = cardObj;
stop();
}
However, when I run the command using sm_adapter against the apm domain I get the following message:
Card Object = CARD-10.2.0.178/NIF-3
Port Object = PORT-10.2.0.178/212
[07-Sep-2011 03:19:53 PM+637ms BST] t@1092262208 main
ASL-W-ERROR_RULE_SOURCE-While executing rule set
'/opt/InCharge7/IP/smarts/local/rules/discovery/realise.asl'
ASL-ERROR_ACTION-While executing action at:
ASL-CALL_STACK_RULE- RuleName: REALISE, Line: 16
ASL-ERROR_OBJECT-Tried to perform a repository operation on a non-object
variable
Just to prove that the objects exist in the repository:
[root@smartsdemo discovery]# dmctl -s apm-server getI Card
CARD-10.2.0.178/MSU-1 CARD-10.2.0.178/MSU-2 CARD-10.2.0.178/NIF-1
CARD-10.2.0.178/NIF-2 CARD-10.2.0.178/NIF-3 CARD-10.2.0.178/NIF-4
CARD-10.2.0.178/NIF-5 CARD-10.2.0.178/NIF-6 CARD-10.2.0.178/NIF-7
CARD-10.2.0.178/NIF-8 CARD-10.2.126.240/1 CARD-10.2.126.240/2
CARD-10.2.126.240/3 CARD-10.2.126.240/4 CARD-10.2.126.240/5
[root@smartsdemo discovery]# dmctl -s apm-server getI Port | grep 212
PORT-10.2.0.178/211 PORT-10.2.0.178/212 PORT-10.2.0.178/213
[root@smartsdemo discovery]#
Can anybody assist in providing the correct syntax for the portObj and cardObj attributes in order for the ASL script to function correctly.
Thanks in advance.
Duncan
No Events found!
FredericMeunier_0588be
143 Posts
0
September 7th, 2011 07:00
Hi Duncan,
your cardObj / portObj ... are not references to the object. You have to use:
cardObj = object( "Card", "CARD-10.2.0.178/NIF-3" );
...
HTH,
== Monitor your Smarts environment using APG Solution Pack for Ionix ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com
monkeyhanger63
9 Posts
0
September 7th, 2011 07:00
Hi Frederic,
Thanks for that, worked first time.
Best Regards,
Duncan