Skip to content
PLSQL interface to syslog deamon
PLSQL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.asciidoc
acl.sql
syslog_ninja.package body.sql
syslog_ninja.package.sql

README.asciidoc

syslog_ninja

Summary

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.

Pre-requisites

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

Installation

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"

Procedures and Functions

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

Examples

-- 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;
/
You can’t perform that action at this time.