source: server/fedora/config/etc/syslog-ng/d_zroot.pl @ 645

Last change on this file since 645 was 645, checked in by quentin, 17 years ago
syslog-ng configuration for zephyring when root logs in
  • Property svn:executable set to *
File size: 533 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Sys::Hostname;
6
7sub sendmsg {
8    my ($message) = @_;
9    open(ZWRITE, "|-", qw|/usr/bin/zwrite -d -c scripts -i root -s|, hostname) or die "Couldn't open zwrite";
10    print ZWRITE $message;
11    close(ZWRITE);
12}
13
14my $last;
15
16while (my $message = <>) {
17    chomp $message;
18    $message =~ s/^(.*?): //;
19    if ($message =~ m|Accepted (\S+) for root|) {
20        my $send = $message;
21        if ($1 eq "gssapi-with-mic") {
22            $send = $last."\n".$send;
23        }
24        sendmsg($send);
25    }
26    $last = $message;
27}
Note: See TracBrowser for help on using the repository browser.