Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
411 additions
and
0 deletions.
There are no files selected for viewing
162 changes: 162 additions & 0 deletions
162
zabbix-vfs-linux/Template vfs File checksum monitor.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<zabbix_export> | ||
<version>4.0</version> | ||
<date>2019-02-19T15:33:55Z</date> | ||
<groups> | ||
<group> | ||
<name>Templates/Appplication</name> | ||
</group> | ||
</groups> | ||
<templates> | ||
<template> | ||
<template>Template vfs File checksum monitor</template> | ||
<name>Template vfs File checksum monitor</name> | ||
<description/> | ||
<groups> | ||
<group> | ||
<name>Templates/Appplication</name> | ||
</group> | ||
</groups> | ||
<applications/> | ||
<items/> | ||
<discovery_rules> | ||
<discovery_rule> | ||
<name>File Discovery</name> | ||
<type>7</type> | ||
<snmp_community/> | ||
<snmp_oid/> | ||
<key>vfs.file.discovery[{$PATH}]</key> | ||
<delay>6h</delay> | ||
<status>0</status> | ||
<allowed_hosts/> | ||
<snmpv3_contextname/> | ||
<snmpv3_securityname/> | ||
<snmpv3_securitylevel>0</snmpv3_securitylevel> | ||
<snmpv3_authprotocol>0</snmpv3_authprotocol> | ||
<snmpv3_authpassphrase/> | ||
<snmpv3_privprotocol>0</snmpv3_privprotocol> | ||
<snmpv3_privpassphrase/> | ||
<params/> | ||
<ipmi_sensor/> | ||
<authtype>0</authtype> | ||
<username/> | ||
<password/> | ||
<publickey/> | ||
<privatekey/> | ||
<port/> | ||
<filter> | ||
<evaltype>0</evaltype> | ||
<formula/> | ||
<conditions/> | ||
</filter> | ||
<lifetime>3d</lifetime> | ||
<description/> | ||
<item_prototypes> | ||
<item_prototype> | ||
<name>Checksum of {$PATH}{#FILENAME}</name> | ||
<type>7</type> | ||
<snmp_community/> | ||
<snmp_oid/> | ||
<key>vfs.file.cksum[{$PATH}{#FILENAME}]</key> | ||
<delay>30m</delay> | ||
<history>14d</history> | ||
<trends>180d</trends> | ||
<status>0</status> | ||
<value_type>3</value_type> | ||
<allowed_hosts/> | ||
<units/> | ||
<snmpv3_contextname/> | ||
<snmpv3_securityname/> | ||
<snmpv3_securitylevel>0</snmpv3_securitylevel> | ||
<snmpv3_authprotocol>0</snmpv3_authprotocol> | ||
<snmpv3_authpassphrase/> | ||
<snmpv3_privprotocol>0</snmpv3_privprotocol> | ||
<snmpv3_privpassphrase/> | ||
<params/> | ||
<ipmi_sensor/> | ||
<authtype>0</authtype> | ||
<username/> | ||
<password/> | ||
<publickey/> | ||
<privatekey/> | ||
<port/> | ||
<description/> | ||
<inventory_link>0</inventory_link> | ||
<applications/> | ||
<valuemap/> | ||
<logtimefmt/> | ||
<preprocessing/> | ||
<jmx_endpoint/> | ||
<timeout>3s</timeout> | ||
<url/> | ||
<query_fields/> | ||
<posts/> | ||
<status_codes>200</status_codes> | ||
<follow_redirects>1</follow_redirects> | ||
<post_type>0</post_type> | ||
<http_proxy/> | ||
<headers/> | ||
<retrieve_mode>0</retrieve_mode> | ||
<request_method>0</request_method> | ||
<output_format>0</output_format> | ||
<allow_traps>0</allow_traps> | ||
<ssl_cert_file/> | ||
<ssl_key_file/> | ||
<ssl_key_password/> | ||
<verify_peer>0</verify_peer> | ||
<verify_host>0</verify_host> | ||
<application_prototypes> | ||
<application_prototype> | ||
<name>Files</name> | ||
</application_prototype> | ||
</application_prototypes> | ||
<master_item/> | ||
</item_prototype> | ||
</item_prototypes> | ||
<trigger_prototypes> | ||
<trigger_prototype> | ||
<expression>{Template vfs File checksum monitor:vfs.file.cksum[{$PATH}{#FILENAME}].diff(0)}>0</expression> | ||
<recovery_mode>0</recovery_mode> | ||
<recovery_expression/> | ||
<name>{#FILENAME} has been changed</name> | ||
<correlation_mode>0</correlation_mode> | ||
<correlation_tag/> | ||
<url/> | ||
<status>0</status> | ||
<priority>2</priority> | ||
<description/> | ||
<type>0</type> | ||
<manual_close>0</manual_close> | ||
<dependencies/> | ||
<tags/> | ||
</trigger_prototype> | ||
</trigger_prototypes> | ||
<graph_prototypes/> | ||
<host_prototypes/> | ||
<jmx_endpoint/> | ||
<timeout>3s</timeout> | ||
<url/> | ||
<query_fields/> | ||
<posts/> | ||
<status_codes>200</status_codes> | ||
<follow_redirects>1</follow_redirects> | ||
<post_type>0</post_type> | ||
<http_proxy/> | ||
<headers/> | ||
<retrieve_mode>0</retrieve_mode> | ||
<request_method>0</request_method> | ||
<allow_traps>0</allow_traps> | ||
<ssl_cert_file/> | ||
<ssl_key_file/> | ||
<ssl_key_password/> | ||
<verify_peer>0</verify_peer> | ||
<verify_host>0</verify_host> | ||
</discovery_rule> | ||
</discovery_rules> | ||
<httptests/> | ||
<macros/> | ||
<templates/> | ||
<screens/> | ||
</template> | ||
</templates> | ||
</zabbix_export> |
191 changes: 191 additions & 0 deletions
191
zabbix-vfs-linux/Template vfs oldest file in folder.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<zabbix_export> | ||
<version>4.0</version> | ||
<date>2019-02-19T15:34:04Z</date> | ||
<groups> | ||
<group> | ||
<name>Templates/Appplication</name> | ||
</group> | ||
</groups> | ||
<templates> | ||
<template> | ||
<template>Template vfs oldest file in folder</template> | ||
<name>Template vfs oldest file in folder</name> | ||
<description/> | ||
<groups> | ||
<group> | ||
<name>Templates/Appplication</name> | ||
</group> | ||
</groups> | ||
<applications> | ||
<application> | ||
<name>Files</name> | ||
</application> | ||
</applications> | ||
<items> | ||
<item> | ||
<name>Oldest file /etc</name> | ||
<type>7</type> | ||
<snmp_community/> | ||
<snmp_oid/> | ||
<key>vfs.file.age[/etc]</key> | ||
<delay>1m</delay> | ||
<history>14d</history> | ||
<trends>180d</trends> | ||
<status>0</status> | ||
<value_type>3</value_type> | ||
<allowed_hosts/> | ||
<units>s</units> | ||
<snmpv3_contextname/> | ||
<snmpv3_securityname/> | ||
<snmpv3_securitylevel>0</snmpv3_securitylevel> | ||
<snmpv3_authprotocol>0</snmpv3_authprotocol> | ||
<snmpv3_authpassphrase/> | ||
<snmpv3_privprotocol>0</snmpv3_privprotocol> | ||
<snmpv3_privpassphrase/> | ||
<params/> | ||
<ipmi_sensor/> | ||
<authtype>0</authtype> | ||
<username/> | ||
<password/> | ||
<publickey/> | ||
<privatekey/> | ||
<port/> | ||
<description/> | ||
<inventory_link>0</inventory_link> | ||
<applications> | ||
<application> | ||
<name>Files</name> | ||
</application> | ||
</applications> | ||
<valuemap/> | ||
<logtimefmt/> | ||
<preprocessing/> | ||
<jmx_endpoint/> | ||
<timeout>3s</timeout> | ||
<url/> | ||
<query_fields/> | ||
<posts/> | ||
<status_codes>200</status_codes> | ||
<follow_redirects>1</follow_redirects> | ||
<post_type>0</post_type> | ||
<http_proxy/> | ||
<headers/> | ||
<retrieve_mode>0</retrieve_mode> | ||
<request_method>0</request_method> | ||
<output_format>0</output_format> | ||
<allow_traps>0</allow_traps> | ||
<ssl_cert_file/> | ||
<ssl_key_file/> | ||
<ssl_key_password/> | ||
<verify_peer>0</verify_peer> | ||
<verify_host>0</verify_host> | ||
<master_item/> | ||
</item> | ||
<item> | ||
<name>Oldest file /root</name> | ||
<type>7</type> | ||
<snmp_community/> | ||
<snmp_oid/> | ||
<key>vfs.file.age[/root]</key> | ||
<delay>1m</delay> | ||
<history>14d</history> | ||
<trends>180d</trends> | ||
<status>0</status> | ||
<value_type>3</value_type> | ||
<allowed_hosts/> | ||
<units>s</units> | ||
<snmpv3_contextname/> | ||
<snmpv3_securityname/> | ||
<snmpv3_securitylevel>0</snmpv3_securitylevel> | ||
<snmpv3_authprotocol>0</snmpv3_authprotocol> | ||
<snmpv3_authpassphrase/> | ||
<snmpv3_privprotocol>0</snmpv3_privprotocol> | ||
<snmpv3_privpassphrase/> | ||
<params/> | ||
<ipmi_sensor/> | ||
<authtype>0</authtype> | ||
<username/> | ||
<password/> | ||
<publickey/> | ||
<privatekey/> | ||
<port/> | ||
<description/> | ||
<inventory_link>0</inventory_link> | ||
<applications> | ||
<application> | ||
<name>Files</name> | ||
</application> | ||
</applications> | ||
<valuemap/> | ||
<logtimefmt/> | ||
<preprocessing/> | ||
<jmx_endpoint/> | ||
<timeout>3s</timeout> | ||
<url/> | ||
<query_fields/> | ||
<posts/> | ||
<status_codes>200</status_codes> | ||
<follow_redirects>1</follow_redirects> | ||
<post_type>0</post_type> | ||
<http_proxy/> | ||
<headers/> | ||
<retrieve_mode>0</retrieve_mode> | ||
<request_method>0</request_method> | ||
<output_format>0</output_format> | ||
<allow_traps>0</allow_traps> | ||
<ssl_cert_file/> | ||
<ssl_key_file/> | ||
<ssl_key_password/> | ||
<verify_peer>0</verify_peer> | ||
<verify_host>0</verify_host> | ||
<master_item/> | ||
</item> | ||
</items> | ||
<discovery_rules/> | ||
<httptests/> | ||
<macros> | ||
<macro> | ||
<macro>{$AGE}</macro> | ||
<value>30m</value> | ||
</macro> | ||
</macros> | ||
<templates/> | ||
<screens/> | ||
</template> | ||
</templates> | ||
<triggers> | ||
<trigger> | ||
<expression>{Template vfs oldest file in folder:vfs.file.age[/etc].last()}>={$AGE}</expression> | ||
<recovery_mode>0</recovery_mode> | ||
<recovery_expression/> | ||
<name>Oldest file in /etc >={$AGE}</name> | ||
<correlation_mode>0</correlation_mode> | ||
<correlation_tag/> | ||
<url/> | ||
<status>0</status> | ||
<priority>4</priority> | ||
<description/> | ||
<type>0</type> | ||
<manual_close>0</manual_close> | ||
<dependencies/> | ||
<tags/> | ||
</trigger> | ||
<trigger> | ||
<expression>{Template vfs oldest file in folder:vfs.file.age[/root].last()}>={$AGE}</expression> | ||
<recovery_mode>0</recovery_mode> | ||
<recovery_expression/> | ||
<name>Oldest file in /root >={$AGE}</name> | ||
<correlation_mode>0</correlation_mode> | ||
<correlation_tag/> | ||
<url/> | ||
<status>0</status> | ||
<priority>4</priority> | ||
<description/> | ||
<type>0</type> | ||
<manual_close>0</manual_close> | ||
<dependencies/> | ||
<tags/> | ||
</trigger> | ||
</triggers> | ||
</zabbix_export> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/perl | ||
|
||
$base = $ARGV[0]; | ||
|
||
opendir(DIR, $base) || die "cannot open directory: $!"; | ||
@subdirs = grep { /^[^.]/ && -d "$base/$_" } readdir(DIR); | ||
closedir(DIR); | ||
|
||
$first = 1; | ||
|
||
print "{\n"; | ||
print "\t\"data\":[\n"; | ||
|
||
for (@subdirs) | ||
{ | ||
print ",\n" if !$first; | ||
print "\t\t{\"{#DIRNAME}\":\"$_\"}"; | ||
$first = 0; | ||
} | ||
|
||
print "\n\t]\n"; | ||
print "}\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
export PATH=${PATH}:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin | ||
|
||
FOLDER="$1" | ||
|
||
FILEPATH="$(find $FOLDER -type f -printf '%T+ %p\n' | sort | head -n 1 | cut -d ' ' -f 2)" | ||
if [ ! "$FILEPATH" ]; then | ||
echo 0 | ||
else | ||
NOW="$(date +%s)" | ||
OLD="$(stat -c %Z $FILEPATH)" | ||
AGE="$((NOW-OLD))" | ||
echo $AGE | ||
fi |
Oops, something went wrong.