You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
656 B
24 lines
656 B
13 years ago
|
#!/usr/bin/perl -w
|
||
|
|
||
|
use Mail::Send;
|
||
|
use esmith::ConfigDB;
|
||
|
|
||
|
my $c = esmith::ConfigDB->open_ro();
|
||
|
my $domain = $c->get('DomainName')->value();
|
||
|
my $host = $c->get('SystemName')->value();
|
||
|
my $z = $c->get('zabbix-agent');
|
||
|
my $dest = $z->prop('StatusRecipient') || 'admin@' . $domain;
|
||
|
|
||
|
my $mail = new Mail::Send;
|
||
|
$mail->to("$dest");
|
||
|
$mail->set("From","zabbix-agent");
|
||
|
$mail->subject("[STATUS] $host.$domain");
|
||
|
my $body = $mail->open;
|
||
|
print $body localtime(time)."\n",
|
||
|
"\n#>tail /var/log/messages :\n",
|
||
|
`/usr/bin/tail /var/log/messages`,
|
||
|
"\n#>netstat --numeric-hosts -tpu :\n",
|
||
|
`/bin/netstat --numeric-hosts -tpu`;
|
||
|
$body->close;
|
||
|
|