NAME
Openview::Message::Sender - OO interface to sending HP OpenView messages.
SYNOPSIS
use Openview::Message::Sender;
my $ovs = new Openview::Message::Sender { application=>'name'
,object=>'name'
,text=>'msg_text"
,group=>'msg_group'
,host=>$ENV{'HOSTNAME'}
};
#take defaults from attributes of $ovs :
$ovs->send( "your message text" );
#or
$ovs->send( text=>"your message text" );
#providing call specific argments overriding the
#some of the defaults provided by the attributes of $ovs :
$ovs->send( text=>"your message text"
,severity=>'minor'
,group=>'MsgGroup' [... etc] );
DESCRIPTION
Openview::Message::Sender also provides an OO interface which maintains default values for most of the the arguments to the Openview opcmsg() API. The defaults are provided at the time the object is constructed. This provides for considerably for less code clutter, and no pollution of your namespace.
EXPORTS
Nothing is exported by default.
METHODS
The OO interface provides the following methods:
new()
Called off the Package. The constructor returns a blessed instance of an Openview::Message::Sender object. This method takes a objection argument which is a hash reference of default values which will be used to call opcmsg().
See ATTRIBUTES for a definition of the attributes recognized.
send()
Sends an Openview opcmsg() using arguments either taken from the hash provided to the call to send(), or from the attributes of the Openview object.
See ATTRIBUTES for a definition of the attributes recognized.
ATTRIBUTES
- application
-
This attribute is used for the opcmsg 'application' argument. This attribute defaults to the string 'application not provided'.
- object
-
This attribute is used for the opcmsg 'object' argument.
This attribute defaults to string 'object not provided'.
- severity
-
This attribute is used for the opcmsg 'severity' argument. The values this takes are lowercase strings which are internally mapped to the Openview severity constants prefixed with 'OVC_SEV_'. As in:
unknown unchanged none normal warning minor major critical
This attribute defaults to 'unknown' (OPC_SEV_UNKNOWN).
If one wants to use the OPC_SEV_* constants they can be imported into your name space if desired, and may be slightly more efficient, then the strings.
- text
-
This attribute is used for the opcmsg 'msg_text' argument. This attribute defaults to the string 'text not provided'.
- group
-
This attribute is used for the opcmsg 'msg_group' argument. This attribute defaults to the string 'undefined'.
- host
-
This attribute is used for the opcmsg hostname argument. It defaults to the value of the HOSTNAME environment variable or "host not provided".
AUTHOR
Lincoln A. Baxter <lab@lincolnbaxter.com>