Where can one find more detail or examples on using Perl with Smarts?
We need to read data from an application log file and then post it into Smarts as a notification. The smarts server and the application server are two different systems. Smarts runs on Solaris 5.9 while the application runs on either a Solaris 5.9 or Windows 2003 platform.
You will either use the "notify" method on an object created by the PERL script, or install the SMARTS adapter platform on the machine and use a logfile adapter to parse the file and create notifications using ASL.
Using PERL you would parse out the object name using split, regex or the like then create your reference. So, once you have the object name.
There is not much, as far as i know, regarding the perl api besides the SMARTs documentation. EMC provides training or at least used to regarding the PERL API. With not much input of your issue/problem one idea is to try with the SMARTS syslog adapter or just a perl script that sends snmp traps to SMARTS. Syslog adapter would be the easist thing to do
I have same problem, I want to create notification from perl script in Smarts SAM . I should to declare events in Model or configuration files ??? My code is
# -- Get instances from class ImapServer foreach $inst (sort $session->getInstances($class)) { print $class . "::" . $inst . "\n";
# -- Create the object for each instance $obj = $session->object($inst);
# -- continue with next element if object is no defined next if ($obj->isNull());
# to notify an event: $session->forceNotify($obj, "BLA", 0, 1);
This is fragment from log file [20-Nov-2008 03:03:01 PM NOVT] Perl-Client-14843-1(126): forceNotify(ImapServer::SRVO-ImapServer::BLA,NOTIFY)
Thank you for response, I originally thought that this method is to create new notification, without Model, so , from PERL API should use "icsNotificationFactory" class.
TCorcoran
53 Posts
472
0
Posted August 13th, 2008 09:00
You will either use the "notify" method on an object created by the PERL script, or install the SMARTS adapter platform on the machine and use a logfile adapter to parse the file and create notifications using ASL.
Using PERL you would parse out the object name using split, regex or the like then create your reference. So, once you have the object name.
$objRef = object($objName);
$objRef->notify("$event");
Where $event would be the notification you want (i.e. Down, Unresponsive, etc...)