#!/opt/ycelib/perl/bin/perl # # use lib "/opt/yce/YCE"; use Common; use File::Basename; use Time::HiRes qw(gettimeofday tv_interval sleep); use Time::Local; use Data::Dumper; $Data::Dumper::Indent = 1; # use strict; # use warnings; use Sys::Syslog qw(:standard :extended :macros); $loghost = '172.17.10.28'; # $proto = 'udp'; $proto = 'tcp'; # $proto = 'inet'; $ident = '172.17.10.21'; $logopt = "ndelay,pid"; $facility = "net"; $rc = setlogsock($proto, $loghost); print "setlogsock -> $rc\n"; $rc = openlog($ident, $logopt, $facility); print "openlog -> $rc\n"; $level = 'info'; $message = "A $facility.$level syslog message to $loghost from $ident using $proto from $0:$$"; print "sending: $message\n"; $rc = syslog("$level", $message); print "syslog -> $rc\n"; 1;