syslog_ninja is a plsql implementation to integrate the database directly with syslog servers. This way we can write errors directly to syslog , for other monitoring applications to read (BMC, Tivoli, etc.). The less you have to configure in these monitoring tools the better.
Any schema installing this package needs the following oracle privileges:
-
create procedure
-
execute on utl_tcp
Aside from this, the schema needs to be part of a network ACL that allows resolve and connect, to the host running the syslog server (look at acl.sql for an example of this).
To install the package simply install the two sql files from this repository, under any schema that fullfills the above pre-requisites.
@"syslog_ninja.package.sql"
@"syslog_ninja.package body.sql"
function lf (
message varchar2
, severity pls_integer default s_warning
, facility pls_integer default f_user_level
, tag varchar2 default t_default
)
return number;procedure lp (
message varchar2
, severity pls_integer default s_warning
, facility pls_integer default f_user_level
, tag varchar2 default t_default
);-- Default invocation of function
select syslog_ninja.lf('Just a function warning') from dual;
-- Default invocation of procedure
exec syslog_ninja.lp('A default procedure warning');
-- Setting the severity to critical:
begin
syslog_ninja.lp(message => 'A critical message', severity => syslog_ninja.s_critical);
end;
/
-- Changing the tag to current schema
begin
syslog_ninja.lp(message => 'Tagged with schema instead of database name', tag => syslog_ninja.t_current_schema);
end;
/