Minor fixes for samba script and template

This commit is contained in:
Daniel Berteaud 2021-01-11 09:28:29 +01:00
parent 2c0eb2e854
commit 19ec29e577
2 changed files with 180 additions and 13 deletions

View File

@ -28,6 +28,10 @@ GetOptions(
'audit-auth-log=s' => \$audit_auth_log
);
if ($since !~ m/^\d+$/){
die "Invalid value for since\n";
}
my $json = {
accounts => {
users => 0,

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>5.0</version>
<date>2021-01-09T16:18:21Z</date>
<date>2021-01-11T08:26:21Z</date>
<groups>
<group>
<name>Templates</name>
@ -47,7 +47,7 @@
</preprocessing>
<triggers>
<trigger>
<expression>{last()}=0</expression>
<expression>{sum(#2)}=0</expression>
<name>DNS is not responding</name>
<priority>WARNING</priority>
</trigger>
@ -188,7 +188,7 @@
</master_item>
<triggers>
<trigger>
<expression>{delta(30m)}&lt;&gt;0</expression>
<expression>{delta(120m)}&lt;&gt;0</expression>
<name>Number of active users changed</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
@ -202,7 +202,8 @@
<delay>0</delay>
<history>60d</history>
<trends>1825d</trends>
<units>!auth</units>
<value_type>FLOAT</value_type>
<units>!auth/min</units>
<applications>
<application>
<name>Samba</name>
@ -213,10 +214,22 @@
<type>JSONPATH</type>
<params>$.activity.authentications.computers.failure</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.2</params>
</step>
</preprocessing>
<master_item>
<key>samba_dc.info[300]</key>
</master_item>
<triggers>
<trigger>
<expression>{min(30m)}&gt;0</expression>
<name>Failed computer authentications</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item>
<item>
<name>Samba: Number of successful computers authentications</name>
@ -225,7 +238,8 @@
<delay>0</delay>
<history>60d</history>
<trends>1825d</trends>
<units>!auth</units>
<value_type>FLOAT</value_type>
<units>!auth/min</units>
<applications>
<application>
<name>Samba</name>
@ -236,6 +250,10 @@
<type>JSONPATH</type>
<params>$.activity.authentications.computers.success</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.2</params>
</step>
</preprocessing>
<master_item>
<key>samba_dc.info[300]</key>
@ -248,7 +266,8 @@
<delay>0</delay>
<history>60d</history>
<trends>1825d</trends>
<units>!auth</units>
<value_type>FLOAT</value_type>
<units>!auth/min</units>
<applications>
<application>
<name>Samba</name>
@ -259,6 +278,10 @@
<type>JSONPATH</type>
<params>$.activity.authentications.users.failure</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.2</params>
</step>
</preprocessing>
<master_item>
<key>samba_dc.info[300]</key>
@ -271,7 +294,8 @@
<delay>0</delay>
<history>60d</history>
<trends>1825d</trends>
<units>!auth</units>
<value_type>FLOAT</value_type>
<units>!auth/min</units>
<applications>
<application>
<name>Samba</name>
@ -282,6 +306,10 @@
<type>JSONPATH</type>
<params>$.activity.authentications.users.success</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.2</params>
</step>
</preprocessing>
<master_item>
<key>samba_dc.info[300]</key>
@ -294,7 +322,8 @@
<delay>0</delay>
<history>60d</history>
<trends>1825d</trends>
<units>!auth</units>
<value_type>FLOAT</value_type>
<units>!auth/min</units>
<applications>
<application>
<name>Samba</name>
@ -305,6 +334,10 @@
<type>JSONPATH</type>
<params>$.activity.authorizations.computers</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.2</params>
</step>
</preprocessing>
<master_item>
<key>samba_dc.info[300]</key>
@ -317,7 +350,8 @@
<delay>0</delay>
<history>60d</history>
<trends>1825d</trends>
<units>!auth</units>
<value_type>FLOAT</value_type>
<units>!auth/min</units>
<applications>
<application>
<name>Samba</name>
@ -328,6 +362,10 @@
<type>JSONPATH</type>
<params>$.activity.authorizations.users</params>
</step>
<step>
<type>MULTIPLIER</type>
<params>0.2</params>
</step>
</preprocessing>
<master_item>
<key>samba_dc.info[300]</key>
@ -380,7 +418,7 @@
</master_item>
<triggers>
<trigger>
<expression>{delta(30m)}&lt;&gt;0</expression>
<expression>{delta(120m)}&lt;&gt;0</expression>
<name>Number of GPO changed</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
@ -411,7 +449,7 @@
</master_item>
<triggers>
<trigger>
<expression>{delta(30m)}&lt;&gt;0</expression>
<expression>{delta(120m)}&lt;&gt;0</expression>
<name>Number of groups changed</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
@ -442,7 +480,7 @@
</master_item>
<triggers>
<trigger>
<expression>{delta(30m)}&lt;&gt;0</expression>
<expression>{delta(120m)}&lt;&gt;0</expression>
<name>Number of inactive users changed</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
@ -533,7 +571,7 @@
</master_item>
<triggers>
<trigger>
<expression>{delta(30m)}&lt;&gt;0</expression>
<expression>{delta(120m)}&lt;&gt;0</expression>
<name>Number of OU changed</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
@ -607,8 +645,133 @@
</item>
</items>
</template>
<template>
<template>Template_App_Samba_DC_Aggregate</template>
<name>Template_App_Samba_DC_Aggregate</name>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<items>
<item>
<name>Samba: Aggregated number of failed computers authentications</name>
<type>AGGREGATE</type>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.computers.failure]&quot;,last]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>auth</units>
</item>
<item>
<name>Samba: Aggregated number of successful computers authentications</name>
<type>AGGREGATE</type>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.computers.success]&quot;,last]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>auth</units>
</item>
<item>
<name>Samba: Aggregated number of failed users authentications</name>
<type>AGGREGATE</type>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.users.failure]&quot;,last]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>auth</units>
</item>
<item>
<name>Samba: Aggregated number of successful users authentications</name>
<type>AGGREGATE</type>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.users.success]&quot;,last]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>auth</units>
</item>
<item>
<name>Samba: Aggregated number of computers authorization requests</name>
<type>AGGREGATE</type>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authorizations.computers]&quot;,last]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>auth</units>
</item>
<item>
<name>Samba: Aggregated number of users authorization requests</name>
<type>AGGREGATE</type>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authorizations.users]&quot;,last]</key>
<delay>5m</delay>
<history>60d</history>
<trends>1825d</trends>
<units>auth</units>
</item>
</items>
<macros>
<macro>
<macro>{$SAMBA_AGGREGATE_GROUP}</macro>
<value>Samba_DC</value>
</macro>
</macros>
</template>
</templates>
<graphs>
<graph>
<name>Samba: Aggregated Authentications &amp; Authorizations</name>
<type>STACKED</type>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>EF9A9A</color>
<item>
<host>Template_App_Samba_DC_Aggregate</host>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authorizations.computers]&quot;,last]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>CE93D8</color>
<item>
<host>Template_App_Samba_DC_Aggregate</host>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.computers.success]&quot;,last]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>9FA8DA</color>
<item>
<host>Template_App_Samba_DC_Aggregate</host>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.computers.failure]&quot;,last]</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<color>81D4FA</color>
<item>
<host>Template_App_Samba_DC_Aggregate</host>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authorizations.users]&quot;,last]</key>
</item>
</graph_item>
<graph_item>
<sortorder>5</sortorder>
<color>B2DFDB</color>
<item>
<host>Template_App_Samba_DC_Aggregate</host>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.users.success]&quot;,last]</key>
</item>
</graph_item>
<graph_item>
<sortorder>6</sortorder>
<color>FFF59D</color>
<item>
<host>Template_App_Samba_DC_Aggregate</host>
<key>grpsum[&quot;{$SAMBA_AGGREGATE_GROUP}&quot;,&quot;samba_dc.info[activity.authentications.users.failure]&quot;,last]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>Samba: Authentications &amp; Authorizations</name>
<show_work_period>NO</show_work_period>