Ignore:
Timestamp:
Feb 25, 2008, 4:26:46 PM (17 years ago)
Author:
quentin
Message:
Make Zephyrs more useful and move to -c scripts-auto
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/fedora/config/etc/syslog-ng/d_zroot.pl

    r664 r665  
    55use Sys::Hostname;
    66
    7 sub sendmsg {
    8     my ($message) = @_;
    9     open(ZWRITE, "|-", qw|/usr/bin/zwrite -d -c scripts-auto|, '-i', 'root.'.hostname, '-s', hostname) or die "Couldn't open zwrite";
     7sub sendmsg($;$$) {
     8    my ($message, $class, $instance) = @_;
     9    $class ||= "scripts-auto";
     10    $instance ||= 'root.'.hostname;
     11    open(ZWRITE, "|-", qw|/usr/bin/zwrite -d -c|, $class, '-i', $instance, '-s', hostname) or die "Couldn't open zwrite";
    1012    print ZWRITE $message;
    1113    close(ZWRITE);
     
    2527            sendmsg($send);
    2628        }
     29    } elsif ($message =~ m|session \S+ for user root |) {
     30        sendmsg($message);
    2731    }
     32
    2833    $last = $message;
    2934}
Note: See TracChangeset for help on using the changeset viewer.