raghvendra1
6 Indium

Re: ASL script question

Hi Tom,

I havent looked at the details of what your problem is, but i can tell you how to do what you want .

Basically in your asl script you have to create a GA_Driver object and run it remote server. SendsActionsTo property of the Driver is the key.

create a driver in asl (one time job, probably in the global block):

trap_to_AM_Hook_driver = self->create("GA_Driver", "DRV-MY-DRIVER");
trap_to_AM_Hook_driver->ReadsRulesFrom = self->create("GA_RuleSet", "RS-DRV-MY-DRIVER");
trap_to_AM_Hook_driver->ReadsRulesFrom->fileName = "icoi-trapd/my.asl";
trap_to_AM_Hook_driver->waitForCompletion=TRUE;

then if you are doing this in trap adapter.

foreach domain (impactedObj->MemberOf) {

     IP_domain= self->create("GA_RestartableServer", "ICS_Domain_Restartable-AM-Server");
    IP_domain->remoteServerName = domain->DomainName;
    IP_domain->trace = FALSE;
    // define the Variables that the driver will need
    trap_to_AM_Hook_driver->setVariable("XX", "YY");

    trap_to_AM_Hook_driver->SendsActionsTo =  IP_domain;
    trap_to_AM_Hook_driver->start();

     //get the return variables.
    yy = trap_to_AM_Hook_driver->getVariable("XX");
}

the variable XX needs to be defined as global XX = "sthg"; in global section of my.asl


Just to give you an idea.Hope it helps.
Regards,
Raghvendra

0 Kudos
towczaruk
6 Indium

Re: ASL script question

Hi Raghvendra

Thank you for you answer. It's help me very much.

But I have one roblem with

yy = trap_to_AM_Hook_driver->getVariable("XX");

returns error

getVariable: Specified operation not found in class,

in GA_Driver I can't find this operation

Operations for class GA_Driver:
    <object> clone <string>clone_name
    <void> clearVariables
    <void> setVariable <string>varName <string>varValue
    <object> getMyParameters <string>mode
    <object> findMyParameters
    <unknown> createParser <object>params
    <void> start
    <void> startWithParameters <object>params

is any other operation which returns value?

in icoi-trapd/my.asl script I set XX and print after and it's OK.

Regards

Tomasz

0 Kudos
mikesolec
6 Indium

Re: ASL script question

Hello Hemull, James,

I need to get the serial number of the routers and switches but i only got this script, how do i go about it? Many thanks! - Mike C

START {
    .. eol
} do {
    devTableQuan = table();
    devTableTime = table();

    print("Device Name,Device Type,SNMPAddress,Vendor,Model,Quan IPs,Quan Net Adapters,First Discovered,Description");

    foreach devName (getInstances("Router")) {
        devObj = object(devName);

   
        print(devObj->Name.",".devObj->CreationClassName.",".devObj->SNMPAddress.",".devObj->Vendor.",".devObj->Model.",".devObj->NumberOfIPs.",".devObj->NumberOfNetworkAdapters.",".devObj->DiscoveredFirstAt.",".devObj->Description);

}
    print("Name,Serial Number");
    foreach devName (getInstances("Chassis")) {
              devObj =object(devName);

    print(devObj->SystemName.",".devObj->SerialNumber);


    }
}

0 Kudos
towczaruk
6 Indium

Re: ASL script question

Hi.

I don't know if I  understand but you want move this serial number to one line? and make some csv file.

You can try with

//I need to get the serial number of the routers and switches but i only got this script, how do i go about it? Many thanks! - Mike C
START {
.. eol
} do {
devTableQuan = table();
devTableTime = table();

print("Device Name,Device Type,SNMPAddress,Vendor,Model,Quan IPs,Quan Net Adapters,First Discovered,Description,SerialNumber");

foreach devName (getInstances("Router")) {
devObj = object(devName);
dev_test = object(devObj->SystemPackagedIn);


print(devObj->Name.",".devObj->CreationClassName.",".devObj->SNMPAddress.",".devObj->Vendor.",".devObj->Model.",".devObj->NumberOfIPs.",".devObj->NumberOfNetworkAdapters.",".devObj->DiscoveredFirstAt.",".devObj->Description.",".dev_test->SerialNumber);
}
//     print("Name,Serial Number");
//     foreach devName (getInstances("Chassis")) {
//               devObj =object(devName);

//   print(devObj->SystemName.",".devObj->SerialNumber);

//   }
}

Regards

Tomasz

0 Kudos
mikesolec
6 Indium

Re: ASL script question

Hi Tomasz,

thanks for the suggestion but its not working, im getting this error

11-May-2011 10:01:20 PM+274ms AUS Eastern Standard Time] t@3480 main
SL-W-ERROR_RULE_SOURCE-While executing rule set
   'C:\InCharge8\scripts\SmartsInventoryReport\SmartsInventoryReport-Detailed
   .asl'
ASL-ERROR_ACTION-While executing action at:
ASL-CALL_STACK_RULE-   RuleName: START, Line: 14
ASL-ERROR_GET-While attempting to get property 'SerialNumber' of object '::'
SVIF-EREMOTE-MR-E-CLASS_NOT_FOUND-Class of given name '' not found; in file
   "t:/DMT-9.0.0.X/1304/smarts/repos/mr/dyn_acc.c" at line 1632
.

regards,

MikeC

0 Kudos
towczaruk
6 Indium

Re: ASL script question

Hi.

Do you run script

sm_adapter -s [server_name]

where    server_name is  IP  Availability and Performance Manager because under SAM probably it won't works

if it still wont woks could you send me output from

dmctl -s IP_APM get Router::[some_router_pick_one]

there should be line looks like this

     SystemPackagedIn = Chassis::CHASSIS-rou_test1

and next

   dmctl -s IP_APM get  Chassis::CHASSIS-rou_test1

output from this last.

Because I use IP v7.0.4 and I guess you have version 8 maybe they changed somethink? But in my env it wokrs fine.

Regards

Tomasz

0 Kudos
mikesolec
6 Indium

Re: ASL script question

Hi Tomasz,

Yes i ran the script using sm adapter and the IP Manager instead of SA, im using version 8.1.1, pls see below requested output. thanks

C:\InCharge8\SAM\smarts\bin>dmctl -s  PLDT-IS-OPSUPP-AM-PM-V8 get Router::10.10.16.99
Server PLDT-IS-OPSUPP-AM-PM-V8 User: admin
admin's Password: XXXXXXXX

Properties of Router::10.10.16.99:
                            AccessMode = ICMPSNMP
                          AggregatedBy = { }
                            Aggregates = { }
               AprioriProbability_Down = 0
                         BridgeAddress =
                 CIM_CreationClassName = Router
                       CIM_Description = Cisco Internetwork Operating System Software \X0D\X0AIOS (tm) RSP Software
(RSP-JSV-M), Version 12.0(7)T,  RELEASE SOFTWARE (fc2)\X0D\X0ACopyright (c) 1986-1999 by cisco Systems, Inc.\X0D\X
0ACompiled Mon 06-Dec-99 19:40 by phanguye
                              CIM_Name = 10.10.16.99
                              CausedBy = { }
                                Causes = { }
                         Certification = CERTIFIED
                            ComposedOf = { Interface::IF-10.10.16.99/9 Fan::FAN-10.10.16.99/5 Interface::IF-10.10.1
6.99/5 Interface::IF-10.10.16.99/10 Fan::FAN-10.10.16.99/3 Interface::IF-10.10.16.99/7 Interface::IF-10.10.16.99/1
TemperatureSensor::TEMP-10.10.16.99/3 Fan::FAN-10.10.16.99/6 VoltageSensor::VOLT-10.10.16.99/1 Fan::FAN-10.10.16.99
/4 TemperatureSensor::TEMP-10.10.16.99/1 Fan::FAN-10.10.16.99/2 Interface::IF-10.10.16.99/8 Interface::IF-10.10.16.
99/6 Memory::MEM-10.10.16.99/1 Card::CARD-10.10.16.99/4 Interface::IF-10.10.16.99/11 Interface::IF-10.10.16.99/4 Ca
rd::CARD-10.10.16.99/2 Memory::MEM-10.10.16.99/5 VoltageSensor::VOLT-10.10.16.99/3 VoltageSensor::VOLT-10.10.16.99/
5 Interface::IF-10.10.16.99/2 Card::CARD-10.10.16.99/1 Processor::PSR-10.10.16.99/1 VoltageSensor::VOLT-10.10.16.99
/4 Fan::FAN-10.10.16.99/1 TemperatureSensor::TEMP-10.10.16.99/2 VoltageSensor::VOLT-10.10.16.99/2 Card::CARD-10.10.
16.99/3 Interface::IF-10.10.16.99/3 }
                         ComposedOfVRs = { }
                          ConfiguredBy = { Configuration::CFG-Polling Groups/Routers Configuration::CFG-System Reso
urce Groups/Host Configuration::CFG-System VLAN Tag Groups/Other Systems Configuration::CFG-System IP Tag Groups/IP
Tag Filter-1 Configuration::CFG-Device Access Configurations/CLI Access Group }
                          ConnectedVia = { IPNetwork::IPNET-10.1.64.116 NetworkConnection::LINK-IF-10.10.16.99/5<->
IF-N_Aparri/6 IPNetwork::IPNET-10.10.224.12 IPNetwork::IPNET-10.10.224.16 IPNetwork::IPNET-10.10.224.36 IPNetwork::
IPNET-10.10.224.20 IPNetwork::IPNET-10.10.224.24 IPNetwork::IPNET-10.10.224.8 IPNetwork::IPNET-10.10.224.4 IPNetwor
k::IPNET-10.10.16.0 Cable::LINK-IF-10.10.16.99/1<->PORT-10.10.16.1/1.23 NetworkConnection::LINK-IF-10.10.16.99/7<->
IF-R_Echague/2 }
                     CreationClassName = Router
                           Description = Cisco Internetwork Operating System Software \X0D\X0AIOS (tm) RSP Software
(RSP-JSV-M), Version 12.0(7)T,  RELEASE SOFTWARE (fc2)\X0D\X0ACopyright (c) 1986-1999 by cisco Systems, Inc.\X0D\X
0ACompiled Mon 06-Dec-99 19:40 by phanguye
                        DesignatedRoot =
                    DesignatedRootPort = 0
                     DiscoveredFirstAt = April 19, 2011 11:00:45 PM GMT+08:00
                      DiscoveredLastAt = May 2, 2011 6:29:58 PM GMT+08:00
             DiscoveredLastAtToSeconds = 1304332197
                    DiscoveryErrorInfo = No response from Ping
                         DiscoveryTime = 0 00:00:02
                      DisplayClassName = Router
                           DisplayName = 10.10.16.99
                                Domain =
                        HasIPAddresses = TRUE
                      HasIPv6Addresses = FALSE
                     HostsAccessPoints = { IP::IP-10.1.64.118 IP::IP-10.10.224.13 IP::IP-10.10.224.17 IP::IP-10.10.
224.37 IP::IP-10.10.224.21 IP::IP-10.10.224.25 IP::IP-10.10.224.9 IP::IP-10.10.224.5 MAC::MAC-00-60-3E-63-A0-20 MAC
::MAC-00-60-3E-63-A0-21 IP::IP-10.10.16.99 }
                         HostsServices = { SNMPAgent::SNMPAgent-10.10.16.99 }
                    IPInstrumentations = { }
                  IPv6Instrumentations = { }
                            ImpactedBy = { }
                               Impacts = { }
                        InstrumentedBy = { }
                         IsAddressable = TRUE
                 IsDiscoveryInProgress = FALSE
                 IsEveryIPUnresponsive = TRUE
               IsEveryIPv6Unresponsive = TRUE
           IsEveryNeighborUnresponsive = FALSE
            IsEveryServiceUnresponsive = TRUE
                             IsManaged = TRUE
                         IsMightBeDown = FALSE
                               IsProxy = FALSE
                                IsSeed = TRUE
             IsUnmanagedOrUnresponsive = TRUE
    IsUnmanagedOrUnresponsive_internal = TRUE
                        IsUnresponsive = FALSE
               IsUnresponsive_internal = FALSE
                                  KEYS = string:CIM_CreationClassName,string:CIM_Name
                           LayeredOver = { }
               ListOfHostsAccessPoints = { IP::IP-10.1.64.118 IP::IP-10.10.224.13 IP::IP-10.10.224.17 IP::IP-10.10.
224.37 IP::IP-10.10.224.21 IP::IP-10.10.224.25 IP::IP-10.10.224.9 IP::IP-10.10.224.5 MAC::MAC-00-60-3E-63-A0-20 MAC
::MAC-00-60-3E-63-A0-21 IP::IP-10.10.16.99 }
                              Location = Cabanatuan 2/F
                              MemberOf = { Partition::Partition-0/PLDT-IS-OPSUPP-AM-PM-V8 }
                                 Model = 7505
                     MonitoringEnabled = TRUE
                                  Name = 10.10.16.99
                            NameFormat = UNSPECIFIED
                    NeighboringSystems = { TerminalServer::10.10.16.153 Host::WSN-EDRCBD-02 Router::N_Cabanatuan Sw
itch::10.10.16.4 Switch::10.10.16.16 Switch::10.10.16.15 Host::NPI1092F8 Router::R_Echague Router::N_Aparri Host::N
PI1350FF Host::10.10.19.180 Host::10.10.16.5 Router::IPBB-Cabanatuan Switch::10.10.16.2 Switch::10.10.16.3 Host::NP
IF30CC2 Switch::10.10.16.1 }
                         Notifications = { }
                           NumberOfIPs = 9
                         NumberOfIPv6s = 0
                    NumberOfInterfaces = 11
               NumberOfNetworkAdapters = 11
                         NumberOfPorts = 0
                             OSVersion =
                                PartOf = { }
                   PrimaryOwnerContact =
                      PrimaryOwnerName =
                         ReadCommunity = He890adrFR
                     ReconfiguredAfter = May 2, 2011 6:29:58 PM GMT+08:00
                      RemoveComponents = TRUE
                           SNMPAddress = 10.10.16.99
                           ServiceName =
                     SettingsAppliedBy = { IPTag_Setting::SET-CFG-System IP Tag Groups/IP Tag Filter-1/IPTag_Settin
g CLI_AccessSetting::SET-CFG-Device Access Configurations/CLI Access Group/CLI_AccessSetting NetworkAdapter_Perform
ancePolling_Setting::SET-CFG-Polling Groups/Routers/NetworkAdapter_PerformancePolling_Setting System_EnvironmentPol
ling_Setting::SET-CFG-Polling Groups/Routers/System_EnvironmentPolling_Setting GarbageCollection_Setting::SET-CFG-P
olling Groups/Routers/GarbageCollection_Setting Connectivity_Polling_Setting::SET-CFG-Polling Groups/Routers/Connec
tivity_Polling_Setting Processor_Performance_Setting::SET-CFG-System Resource Groups/Host/Processor_Performance_Set
ting FileSystem_Performance_Setting::SET-CFG-System Resource Groups/Host/FileSystem_Performance_Setting Processor_P
erformancePolling_Setting::SET-CFG-Polling Groups/Routers/Processor_PerformancePolling_Setting System_Environment_S
etting::SET-CFG-System Resource Groups/Host/System_Environment_Setting Default_Route_Polling_Setting::SET-CFG-Polli
ng Groups/Routers/Default_Route_Polling_Setting }
                ShortDiscoveredFirstAt =
                 ShortDiscoveredLastAt =
                    ShortDiscoveryTime =
                         SourceAddress = 0.0.0.0
                          SupportsSNMP = TRUE
                            SystemName = 10.10.16.99
                        SystemObjectID = .1.3.6.1.4.1.9.1.48
                      SystemPackagedIn = Chassis::CHASSIS-10.10.16.99
                                  Type = ROUTER
                            Underlying = { }
               UseBridgingRelationship = TRUE
                                Vendor = CISCO
              VirtualHostsAccessPoints = { }
                              indexVal =

C:\InCharge8\SAM\smarts\bin>dmctl -s PLDT-IS-OPSUPP-AM-PM-V8 get Chassis::CHASSIS-10.10.16.99
Server PLDT-IS-OPSUPP-AM-PM-V8 User: admin
admin's Password: XXXXXXXX

Properties of Chassis::CHASSIS-10.10.16.99:
               AggregatedBy = { }
                 Aggregates = { }
    AprioriProbability_Down = 0
       BackplaneUtilization = <unknown>
      CIM_CreationClassName = Chassis
            CIM_Description =
                   CIM_Name = CHASSIS-10.10.16.99
                   CausedBy = { }
                     Causes = { }
                 ComposedOf = { Card::CARD-10.10.16.99/1 Card::CARD-10.10.16.99/2 Card::CARD-10.10.16.99/3 Card::CA
RD-10.10.16.99/4 }
               ConfiguredBy = { }
          CreationClassName = Chassis
                Description =
           DisplayClassName = Chassis
                DisplayName = CHASSIS-10.10.16.99
                 ImpactedBy = { }
                    Impacts = { }
             InstrumentedBy = { }
      IsAnySystemResponsive = TRUE
                  IsManaged = TRUE
                       KEYS = string:Tag,string:CIM_CreationClassName
                   Location =
                   MemberOf = { }
          MonitoringEnabled = TRUE
                       Name = CHASSIS-10.10.16.99
              Notifications = { }
            PackageCooledBy = { Fan::FAN-10.10.16.99/6 Fan::FAN-10.10.16.99/4 Fan::FAN-10.10.16.99/5 Fan::FAN-10.10
.16.99/2 Fan::FAN-10.10.16.99/3 Fan::FAN-10.10.16.99/1 }
      PackageTempMeasuredBy = { TemperatureSensor::TEMP-10.10.16.99/1 TemperatureSensor::TEMP-10.10.16.99/2 Tempera
tureSensor::TEMP-10.10.16.99/3 }
            PackagesSystems = { Router::10.10.16.99 }
                     PartOf = { }
                   Realizes = { }
               SerialNumber =
                ServiceName =
          SettingsAppliedBy = { }
                     Status = UNKNOWN
                 SystemName = 10.10.16.99
                        Tag = 10.10.16.99
                       Type =
                   indexVal =

0 Kudos
towczaruk
6 Indium

Re: ASL script question

Hi

I don't know why it don't create object with this Chassis::CHASSIS-10.10.16.99

Could you send me some output lines from this?

Regards

Tomasz

START {

} do {

foreach devName (getInstances("Router")) {
devObj = object(devName);
dev_test = devObj->SystemPackagedIn;
print(devObj->Name.",".dev_test);
print();

}
}

0 Kudos
mikesolec
6 Indium

Re: ASL script question

Hi Tomasz,

I noticed that it is actually working when i viewed the CSV file C:\InCharge8\SAM\smarts\bin>sm_adapter -s PLDT-IS-OPSUPP-AM-PM-V8 SmartsInventor
yReport-Detailed.asl >c:\PLDT-IS-OPSUPP-AM-PM-V8-may11-2011.csv

but it only got 179 instances or Router out of 189, and shows an error in the command line below. Also, instead of getting the SNMP IP add, how can I add the found IP addresses of the routers in the script? Many thanks -regards, Mike C

[11-May-2011 11:51:15 PM+243ms AUS Eastern Standard Time] t@3420 main
ASL-W-ERROR_RULE_SOURCE-While executing rule set
    'C:\InCharge8\SAM\smarts\bin\SmartsInventoryReport-Detailed.asl'
ASL-ERROR_ACTION-While executing action at:
ASL-CALL_STACK_RULE-   RuleName: START, Line: 15
ASL-ERROR_GET-While attempting to get property 'SerialNumber' of object '::'
SVIF-EREMOTE-MR-E-CLASS_NOT_FOUND-Class of given name '' not found; in file
    "t:/DMT-9.0.0.X/1304/smarts/repos/mr/dyn_acc.c" at line 1632
  .

0 Kudos
mikesolec
6 Indium

Re: ASL script question

Also this one, when i lookup for switches, it only worked for two devices and got the error, so it won't continue extracting the switch devices

C:\InCharge8\SAM\smarts\bin>sm_adapter -s PLDT-IS-OPSUPP-AM-PM-V8 SmartsInventor
yReport-Detailed.asl
Server PLDT-IS-OPSUPP-AM-PM-V8 User: admin
admin's Password: XXXXXXXX
Device Name,Device Type,SNMPAddress,Vendor,Model,Quan IPs,Quan Net Adapters,Seri
alNumber
S-RCB_4F_Cisco2960_ISNet-06,Switch,10.2.240.20,CISCO,2960G-24TC,1,25,Serial#:FOC
1311Z4AW
S-MGO_10F_Cisco2960_ISNet-05,Switch,10.3.16.5,CISCO,2960G-24TC,1,25,Serial#:FOC1
311Z4JG
[12-May-2011 12:10:36 AM+821ms AUS Eastern Standard Time] t@2420 main
ASL-W-ERROR_RULE_SOURCE-While executing rule set
    'C:\InCharge8\SAM\smarts\bin\SmartsInventoryReport-Detailed.asl'
ASL-ERROR_ACTION-While executing action at:
ASL-CALL_STACK_RULE-   RuleName: START, Line: 15
ASL-ERROR_GET-While attempting to get property 'SerialNumber' of object '::'
SVIF-EREMOTE-MR-E-CLASS_NOT_FOUND-Class of given name '' not found; in file
    "t:/DMT-9.0.0.X/1304/smarts/repos/mr/dyn_acc.c" at line 1632
  .

0 Kudos