Unsolved
This post is more than 5 years old
3 Posts
0
1524
February 4th, 2011 00:00
Perl API to extract event details from SAM/APM
Hi,
Is there a PERL API which provides
1) Last Occurance time of the event
2) Status of the event
3) Class
4) Event type
5) Description of the event
Can some one help me how to approach in writing a script to get the above mentioned list
Wht i tried doing this
use strict;
use DBI;
use InCharge::session;
use InCharge::object;
my (@routers,$router, $session, $observer, $obj, $vendor, $name, $fs, $event,$element,$const,@all);
$session = InCharge::session->new(
domain=>"110.102.119.10:9901/MYSAM9901", # ip and
username=>"oneuser",
password=>"onepass"
);
$observer = $session->observer( );
@all = $session->getInstances("ICIM_UnitaryComputerSystem");
foreach $element(@all) {
$const = "ICIM_UnitaryComputerSystem::".$element;
$session->subscribeEvent($const, "Down");
$fs = "|";
$event = join( $fs, $observer->receiveEvent( ) );
print $event . "\n";
}
Run this patch of code, which gives me an output
1296823339|ACCEPT|ICIM_UnitaryComputerSystem|Microsoft_SERVER|Down
what i understand is i need to subscribe for an event type and then use receiveEvent() method .But this doesnt give me the intended results as mentioned at the beginning .
Or should i use something like ICIM_Notification
./dmctl -s MYSAM9901 get ICIM_NotificationListInterface::ICS_NL-Maintenance::AllNotificationsData
if so can some one tell me the ICIM_Notification perl API modules ?
Awaiting for a good response from you guys
Thanks & REgards
Gani