Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1149

August 12th, 2008 06:00

Perl API

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.

53 Posts

August 13th, 2008 09:00

I agree on the sparseness of the documentation.

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...)

89 Posts

August 12th, 2008 22:00

Hi Jacko,

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

cheers

Fernando

2 Intern

 • 

138 Posts

November 20th, 2008 02:00

Hello

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)

53 Posts

December 26th, 2008 17:00

Hemul,

You will need to ensure that your BLA problem is defined in the MODEL before you use the Perl API to notify on it.

2 Intern

 • 

138 Posts

December 28th, 2008 20:00

Hello TCorcoran !

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.


https://forums.emc.com/forums/thread.jspa?threadID=95386&tstart=0

53 Posts

January 5th, 2009 10:00

Hemul,

That is correct, you can programatically define your notification within the perl code instead of using MODEL.
No Events found!

Top