Compare commits

...

18 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
Daniel Berteaud 3e23c01d30 Automatic commit of package [smeserver-zabbix-agent] release [0.4.5-1].
Created by command:

/usr/bin/tito tag
2019-11-27 09:47:30 +01:00
Daniel Berteaud ca89c3027d Adapt spec file for tito 2019-11-27 09:47:19 +01:00
Daniel Berteaud e9f44d8d03 Detect if running >= 4.4, and remove vfs.dev.discovery UserParameter in this case 2019-11-27 09:45:47 +01:00
Daniel Berteaud 4cd1050cfc Automatic commit of package [smeserver-zabbix-agent] release [0.4.3-1].
Created by command:

/usr/bin/tito tag
2019-11-26 18:54:50 +01:00
Daniel Berteaud 1dedbd22bf Configure build with tito 2019-11-26 18:54:34 +01:00
Daniel Berteaud 7bdf91d788 Initialized to use tito. 2019-11-26 18:52:09 +01:00
Daniel Berteaud b684b4db0a Spec file update 2016-05-03 15:21:40 +02:00
Daniel Berteaud a4d7a2a48a Add regex for DMARC rejection
and support for the spf_deny plugin
2016-05-03 15:18:15 +02:00
Daniel Berteaud 22d6a1eaaa Spec file update 2016-04-27 09:44:05 +02:00
Daniel Berteaud 2d482d9675 Adapt qpsmtpd regex for naughty rejects 2016-04-27 08:44:49 +02:00
Daniel Berteaud 3bd3ee67e0 Spec file update 2016-04-25 09:01:55 +02:00
9 changed files with 98 additions and 37 deletions

3
.tito/packages/.readme Normal file
View File

@ -0,0 +1,3 @@
the .tito/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.

View File

@ -0,0 +1 @@
0.4.8-1 ./

1
.tito/releasers.conf Symbolic link
View File

@ -0,0 +1 @@
../../tito_libs/releasers.conf

6
.tito/tito.props Normal file
View File

@ -0,0 +1,6 @@
[buildconfig]
builder = tito.builder.Builder
tagger = tito.tagger.VersionTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)
lib_dir = ../tito_libs

View File

@ -7,7 +7,7 @@ foreach my $conf (qw!zabbix_agentd.conf zabbix_agentd.conf.d/asterisk.conf
zabbix_agentd.conf.d/deprecated_cpunum.conf zabbix_agentd.conf.d/deprecated_memory.conf
zabbix_agentd.conf.d/deprecated_netstat.conf zabbix_agentd.conf.d/deprecated_swap.conf
zabbix_agentd.conf.d/extip.conf zabbix_agentd.conf.d/mail.conf zabbix_agentd.conf.d/mysql.conf
zabbix_agentd.conf.d/phpki_certs.conf zabbix_agentd.conf.d/samba.conf!){
zabbix_agentd.conf.d/phpki_certs.conf zabbix_agentd.conf.d/samba.conf zabbix_agentd.conf.d/block_devices.conf!){
templates2events("/etc/zabbix/$conf", qw(zabbix-agent-update bootstrap-console-save));
}
templates2events("/etc/sudoers", "zabbix-agent-update");

View File

@ -0,0 +1,13 @@
{
$OUT = '';
qx(zabbix_agentd -t vfs.dev.discovery -c /dev/null | grep -q ZBX_NOTSUPPORTED);
if ($? != 0){
$OUT .= '# vfs.dev.discovery is natively supported, not UserParameter needed';
} else{
$OUT .=<<'_EOF';
# Discover block devices
UserParameter=vfs.dev.discovery,/var/lib/zabbix/bin/disco_block_devices
_EOF
}
}

View File

@ -26,17 +26,18 @@ my $what = $ARGV[0] || '';
# This is the list of plugins we can get stats for
# you can set the regex used to identify a line in the logs
my %denied = (
dnsbl => qr{dnsbl\s+90},
dnsbl => qr{(dnsbl\s+90|naughty\s+90\d\s+\(dnsbl\))},
rhsbl => qr{rhsbl\s+90},
uribl => qr{uribl\s+90},
clamav => qr{virus::clam(av|dscan)\s+90},
check_earlytalker => qr{(check_)?earlytalker\s+90},
check_basicheaders => qr{(check_basic)?headers\s+90},
check_goodrcptto => qr{(check_)?goodrcptto\s+90},
check_spamhelo => qr{(check_spam)?helo\s+90},
check_spamhelo => qr{((check_spam)?helo\s+90|naughty\s+90\d\s+\(helo\))},
fcrdns => qr{fcrdns\s+90},
karma => qr{karma\s+90},
spf => qr{sender_permitted_from\s+90},
karma => qr{(karma\s+90|naughty\s+90\d\s+\(karma\))},
spf => qr{(sender_permitted_from|spf_deny)\s+90},
dmarc => qr{dmarc\s+90},
tls_failed => qr{tls\s+90},
resolvable_fromhost => qr{(require_)?resolvable_fromhost}
);
@ -86,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,14 +1,7 @@
# $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.0
%define release 1
Summary: sme server integration of zabbix agent
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Name: smeserver-zabbix-agent
Version: 0.4.8
Release: 1%{?dist}
License: GNU GPL version 2
URL: http://www.zabbix.com/
Group: SMEserver/addon
@ -34,6 +27,43 @@ 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
case (daniel@firewall-services.com)
* Wed Nov 27 2019 Daniel Berteaud <daniel@firewall-services.com>
- Detect if running >= 4.4, and remove vfs.dev.discovery UserParameter in this
case (daniel@firewall-services.com)
* Tue Nov 26 2019 Daniel Berteaud <daniel@firewall-services.com> 0.4.3-1
- new package built with tito
* Tue May 3 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.4.3-1.sme
- Add dmarc regex in util_parse_mail_in and add support for spf_deny plugin
* Wed Apr 27 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.4.2-1.sme
- Adapt qpsmtpd parser regex to match naughty rejects against the original
plugin
* Tue Apr 19 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.4.1-1.sme
- Adapt util_parse_mail_in and util_count_mail_in to work with qpsmtpd 0.96
- Define %clean before %files so epel-macros don't try to add a default
buggy %clean on el5
* Mon Mar 21 2016 Daniel Berteaud <daniel@firewall-services.com> - 0.4.0-1.sme
- Add support for new encryption features of zabbix 3.0
@ -292,14 +322,12 @@ 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
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%postun
#uninstall