Minor fixes for samba script and template

tags/zabbix-agent-addons-0.2.138-1
Daniel Berteaud 4 years ago
parent 2c0eb2e854
commit 19ec29e577
  1. 4
      zabbix_scripts/check_samba_dc_sudo
  2. 189
      zabbix_templates/Template_App_Samba_DC.xml

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

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

Loading…
Cancel
Save