Compare commits

...

7 Commits

Author SHA1 Message Date
Daniel Berteaud b81a6d1237 Automatic commit of package [smeserver-zabbix-agent] release [0.4.8-1].
Created by command:

/usr/bin/tito tag
2020-05-29 09:35:00 +02:00
Daniel Berteaud 85fb39af13 Adapt regex to match queued emails when spam filtering is disabled 2020-05-29 09:34:41 +02:00
Daniel Berteaud 905bfdce90 Automatic commit of package [smeserver-zabbix-agent] release [0.4.7-1].
Created by command:

/usr/bin/tito tag
2020-02-27 18:33:04 +01:00
Daniel Berteaud 972ef40482 Rewrite util_send_status_mail to go through the SMTP server
So emails get signed by qpsmtpd
2020-02-27 18:32:32 +01:00
Daniel Berteaud 437332781d Remove useless var in spec file 2020-02-27 18:31:52 +01:00
Daniel Berteaud fbc8f88ae0 Automatic commit of package [smeserver-zabbix-agent] release [0.4.6-1].
Created by command:

/usr/bin/tito tag
2019-11-27 09:51:23 +01:00
Daniel Berteaud 8206e8796e Remove the git CHANGELOG as it's not generated anymore 2019-11-27 09:51:05 +01:00
4 changed files with 41 additions and 28 deletions

View File

@ -1 +1 @@
0.4.5-1 ./
0.4.8-1 ./

View File

@ -87,8 +87,8 @@ while (<STDIN>) {
next;
}
# Queued, not tagged as spam, those are the clean emails
elsif ($line =~ m/queued\s+<.*>\s+No,\s+(score|hits)=/){
# Queued, not tagged as spam (or spam filtering disabled), those are the clean emails
elsif ($line =~ m/queued\s+<.*>(\s+No,\s+(score|hits)=.+)?/){
$cnt{queued}++;
next;
}

View File

@ -1,23 +1,31 @@
#!/usr/bin/perl -w
use Mail::Send;
use esmith::ConfigDB;
use MIME::Lite;
use Net::SMTP;
my $c = esmith::ConfigDB->open_ro();
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 $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 \$(readlink /var/log/messages)`,
"\n#>netstat --numeric-hosts -tpu :\n",
`/bin/netstat --numeric-hosts -tpu`;
$body->close;
my $smtp = Net::SMTP->new('localhost');
my $mail = MIME::Lite->new(
From => 'smeserver-status@' . $domain,
To => $dest,
Subject => "[STATUS] $host.$domain",
Data => localtime(time)."\n" .
"\n#>tail /var/log/messages :\n" .
`/usr/bin/tail \$(readlink /var/log/messages)` .
"\n#>netstat --numeric-hosts -tpu :\n" .
`/bin/netstat --numeric-hosts -tpu`
);
$smtp->mail('smeserver-status@' . $domain);
$smtp->recipient($dest);
$smtp->data();
$smtp->datasend($mail->as_string);
$smtp->dataend();
$smtp->quit;

View File

@ -1,13 +1,6 @@
# $Id: smeserver-zabbix-agent.spec,v 1.34 2012/06/07 16:26:43 vip-ire Exp $
# Authority: vip-ire
# Name: Daniel Berteaud
%define name smeserver-zabbix-agent
%define version 0.4.3
%define release 1
Summary: sme server integration of zabbix agent
Name: smeserver-zabbix-agent
Version: 0.4.5
Version: 0.4.8
Release: 1%{?dist}
License: GNU GPL version 2
URL: http://www.zabbix.com/
@ -34,6 +27,19 @@ Zabbix is an entreprise-class open source distributed monitoring
solution
%changelog
* Fri May 29 2020 Daniel Berteaud <daniel@firewall-services.com> 0.4.8-1
- Adapt regex to match queued emails when spam filtering is disabled
(daniel@firewall-services.com)
* Thu Feb 27 2020 Daniel Berteaud <daniel@firewall-services.com> 0.4.7-1
- Rewrite util_send_status_mail to go through the SMTP server (daniel@firewall-
services.com)
- Remove useless var in spec file (daniel@firewall-services.com)
* Wed Nov 27 2019 Daniel Berteaud <daniel@firewall-services.com> 0.4.6-1
- Remove the git CHANGELOG as it's not generated anymore (daniel@firewall-
services.com)
* Wed Nov 27 2019 Daniel Berteaud <daniel@firewall-services.com> 0.4.5-1
- Adapt spec file for tito (daniel@firewall-services.com)
- Detect if running >= 4.4, and remove vfs.dev.discovery UserParameter in this
@ -316,7 +322,6 @@ rm -f %{name}-%{version}-filelist
--file /var/lib/zabbix/bin/check_certs_sudo 'attr(0750,root,zabbix)' \
--dir /var/lib/zabbix/tmp 'attr(0750,zabbix,zabbix)' \
> %{name}-%{version}-filelist
echo "%doc CHANGELOG.git" >> %{name}-%{version}-filelist
%clean
rm -rf $RPM_BUILD_ROOT