/[smecontribs]/rpms/smeserver-zabbix-agent/contribs7/smeserver-zabbix-agent-0.1-statusmail.patch
ViewVC logotype

Contents of /rpms/smeserver-zabbix-agent/contribs7/smeserver-zabbix-agent-0.1-statusmail.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed May 4 16:18:49 2011 UTC (13 years, 6 months ago) by vip-ire
Branch: MAIN
CVS Tags: smeserver-zabbix-agent-0_1-48_el4_sme, smeserver-zabbix-agent-0_1-47_el4_sme, smeserver-zabbix-agent-0_1-50_el4_sme, smeserver-zabbix-agent-0_1-51_el4_sme, smeserver-zabbix-agent-0_1-52_el4_sme, smeserver-zabbix-agent-0_1-49_el4_sme, HEAD
Error occurred while calculating annotation data.
* Wed May 04 2011 Daniel B. <daniel@firewall-services.com> 0.1-47
- Send status mail with some logs and active connexions (StatusMail prop)

1 diff -Nur smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats smeserver-zabbix-agent-0.1_mod/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats
2 --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats 2011-05-04 17:21:02.000000000 +0200
3 +++ smeserver-zabbix-agent-0.1_mod/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats 2011-05-04 17:26:11.000000000 +0200
4 @@ -1,11 +1,20 @@
5 {
6 if ((${'zabbix-agent'}{'status'} || 'disabled') eq 'enabled'){
7 -$OUT .=<<"HERE";
8 + $OUT .=<<"HERE";
9
10 # Parse mail logs and write stats in zabbix tmp directory
11 */10 * * * * root /var/lib/zabbix/bin/mail_in.sh
12 */10 * * * * root /var/lib/zabbix/bin/mail_out.sh
13
14 HERE
15 +
16 + if ((${'zabbix-agent'}{'StatusMail'} || 'disabled' ) eq 'enabled'){
17 + $OUT .=<<"HERE";
18 +
19 +# Send a status mail
20 +*/15 * * * * root /var/lib/zabbix/bin/mailstatus.pl
21 +
22 +HERE
23 + }
24 }
25 }
26 diff -Nur smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mailstatus.pl smeserver-zabbix-agent-0.1_mod/root/var/lib/zabbix/bin/mailstatus.pl
27 --- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mailstatus.pl 1970-01-01 01:00:00.000000000 +0100
28 +++ smeserver-zabbix-agent-0.1_mod/root/var/lib/zabbix/bin/mailstatus.pl 2011-05-04 17:22:24.000000000 +0200
29 @@ -0,0 +1,23 @@
30 +#!/usr/bin/perl -w
31 +
32 +use Mail::Send;
33 +use esmith::ConfigDB;
34 +
35 +my $c = esmith::ConfigDB->open_ro();
36 +my $domain = $c->get('DomainName')->value();
37 +my $host = $c->get('SystemName')->value();
38 +my $z = $c->get('zabbix-agent');
39 +my $dest = $z->prop('StatusRecipient') || 'admin@' . $domain;
40 +
41 +my $mail = new Mail::Send;
42 +$mail->to("$dest");
43 +$mail->set("From","zabbix-agent");
44 +$mail->subject("[STATUS] $host.$domain");
45 +my $body = $mail->open;
46 +print $body localtime(time)."\n",
47 + "\n#>tail /var/log/messages :\n",
48 + `/usr/bin/tail /var/log/messages`,
49 + "\n#>netstat --numeric-hosts -tpu :\n",
50 + `/bin/netstat --numeric-hosts -tpu`;
51 +$body->close;
52 +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed