Skip to content

Commit

Permalink
Adding Fan Level discovery items
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrice Gautier authored and Patrice Gautier committed Aug 30, 2021
1 parent 00fcc06 commit d1d7fec
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 3 deletions.
54 changes: 53 additions & 1 deletion zbx_export_templates.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"zabbix_export": {
"version": "5.4",
"date": "2021-08-25T21:27:52Z",
"date": "2021-08-30T22:33:56Z",
"groups": [
{
"uuid": "15155c95a3d048f4856272ae12fd42c5",
Expand Down Expand Up @@ -3395,6 +3395,7 @@
"name": "mca-dump-feature-discovery",
"type": "EXTERNAL",
"key": "mca-dump-short.sh[\"-d\",\"{HOST.CONN}\", \"-u\", \"{$UNIFI_USER}\", \"-i\", \"{$UNIFI_SSH_PRIV_KEY_PATH}\", \"-t\", \"SWITCH_FEATURE_DISCOVERY\", \"-p\", \"{$UNIFI_SSHPASS_PASSWORD_PATH}\" ]",
"delay": "15m",
"history": "0",
"trends": "0",
"value_type": "TEXT",
Expand Down Expand Up @@ -3634,6 +3635,57 @@
}
],
"discovery_rules": [
{
"uuid": "c63e03a538104cdebad4f428337e2952",
"name": "Fan Discovery",
"type": "DEPENDENT",
"key": "fan_discovery",
"delay": "0",
"item_prototypes": [
{
"uuid": "b84302d8102645eb882c4cec6131dddc",
"name": "Fan Level",
"type": "DEPENDENT",
"key": "_[{#FAN_LEVEL_KEY_NAME}]",
"delay": "0",
"units": "%",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.fan_level"
]
}
],
"master_item": {
"key": "mca-dump-short.sh[\"-d\",\"{HOST.CONN}\", \"-u\", \"{$UNIFI_USER}\", \"-i\", \"{$UNIFI_SSH_PRIV_KEY_PATH}\", \"-t\", \"SWITCH\", \"-p\", \"{$UNIFI_SSHPASS_PASSWORD_PATH}\" ]"
},
"tags": [
{
"tag": "Application",
"value": "Power"
}
]
}
],
"master_item": {
"key": "mca-dump-short.sh[\"-d\",\"{HOST.CONN}\", \"-u\", \"{$UNIFI_USER}\", \"-i\", \"{$UNIFI_SSH_PRIV_KEY_PATH}\", \"-t\", \"SWITCH_FEATURE_DISCOVERY\", \"-p\", \"{$UNIFI_SSHPASS_PASSWORD_PATH}\" ]"
},
"lld_macro_paths": [
{
"lld_macro": "{#FAN_LEVEL_KEY_NAME}",
"path": "$.fan_level_key_name"
}
],
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$[?(@.has_fan==\"true\")]"
]
}
]
},
{
"uuid": "3440ec98490a4b40bcc1dddca0955cb8",
"name": "POE Discovery",
Expand Down
54 changes: 53 additions & 1 deletion zbx_export_templates.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>5.4</version>
<date>2021-08-25T21:27:50Z</date>
<date>2021-08-30T22:33:54Z</date>
<groups>
<group>
<uuid>15155c95a3d048f4856272ae12fd42c5</uuid>
Expand Down Expand Up @@ -3426,6 +3426,7 @@ Additionally,. this will fill the OS version and the MAC address in the inventor
<name>mca-dump-feature-discovery</name>
<type>EXTERNAL</type>
<key>mca-dump-short.sh[&quot;-d&quot;,&quot;{HOST.CONN}&quot;, &quot;-u&quot;, &quot;{$UNIFI_USER}&quot;, &quot;-i&quot;, &quot;{$UNIFI_SSH_PRIV_KEY_PATH}&quot;, &quot;-t&quot;, &quot;SWITCH_FEATURE_DISCOVERY&quot;, &quot;-p&quot;, &quot;{$UNIFI_SSHPASS_PASSWORD_PATH}&quot; ]</key>
<delay>15m</delay>
<history>0</history>
<trends>0</trends>
<value_type>TEXT</value_type>
Expand Down Expand Up @@ -3665,6 +3666,57 @@ Additionally,. this will fill the OS version and the MAC address in the inventor
</item>
</items>
<discovery_rules>
<discovery_rule>
<uuid>c63e03a538104cdebad4f428337e2952</uuid>
<name>Fan Discovery</name>
<type>DEPENDENT</type>
<key>fan_discovery</key>
<delay>0</delay>
<item_prototypes>
<item_prototype>
<uuid>b84302d8102645eb882c4cec6131dddc</uuid>
<name>Fan Level</name>
<type>DEPENDENT</type>
<key>_[{#FAN_LEVEL_KEY_NAME}]</key>
<delay>0</delay>
<units>%</units>
<preprocessing>
<step>
<type>JSONPATH</type>
<parameters>
<parameter>$.fan_level</parameter>
</parameters>
</step>
</preprocessing>
<master_item>
<key>mca-dump-short.sh[&quot;-d&quot;,&quot;{HOST.CONN}&quot;, &quot;-u&quot;, &quot;{$UNIFI_USER}&quot;, &quot;-i&quot;, &quot;{$UNIFI_SSH_PRIV_KEY_PATH}&quot;, &quot;-t&quot;, &quot;SWITCH&quot;, &quot;-p&quot;, &quot;{$UNIFI_SSHPASS_PASSWORD_PATH}&quot; ]</key>
</master_item>
<tags>
<tag>
<tag>Application</tag>
<value>Power</value>
</tag>
</tags>
</item_prototype>
</item_prototypes>
<master_item>
<key>mca-dump-short.sh[&quot;-d&quot;,&quot;{HOST.CONN}&quot;, &quot;-u&quot;, &quot;{$UNIFI_USER}&quot;, &quot;-i&quot;, &quot;{$UNIFI_SSH_PRIV_KEY_PATH}&quot;, &quot;-t&quot;, &quot;SWITCH_FEATURE_DISCOVERY&quot;, &quot;-p&quot;, &quot;{$UNIFI_SSHPASS_PASSWORD_PATH}&quot; ]</key>
</master_item>
<lld_macro_paths>
<lld_macro_path>
<lld_macro>{#FAN_LEVEL_KEY_NAME}</lld_macro>
<path>$.fan_level_key_name</path>
</lld_macro_path>
</lld_macro_paths>
<preprocessing>
<step>
<type>JSONPATH</type>
<parameters>
<parameter>$[?(@.has_fan==&quot;true&quot;)]</parameter>
</parameters>
</step>
</preprocessing>
</discovery_rule>
<discovery_rule>
<uuid>3440ec98490a4b40bcc1dddca0955cb8</uuid>
<name>POE Discovery</name>
Expand Down
39 changes: 38 additions & 1 deletion zbx_export_templates.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
zabbix_export:
version: '5.4'
date: '2021-08-25T21:27:47Z'
date: '2021-08-30T22:33:51Z'
groups:
-
uuid: 15155c95a3d048f4856272ae12fd42c5
Expand Down Expand Up @@ -2579,6 +2579,7 @@ zabbix_export:
name: mca-dump-feature-discovery
type: EXTERNAL
key: 'mca-dump-short.sh["-d","{HOST.CONN}", "-u", "{$UNIFI_USER}", "-i", "{$UNIFI_SSH_PRIV_KEY_PATH}", "-t", "SWITCH_FEATURE_DISCOVERY", "-p", "{$UNIFI_SSHPASS_PASSWORD_PATH}" ]'
delay: 15m
history: '0'
trends: '0'
value_type: TEXT
Expand Down Expand Up @@ -2752,6 +2753,42 @@ zabbix_export:
name: '{HOST.NAME} SSH has not been available for more than {$UNIFI_ALERT_PERIOD}'
expression: 'nodata(/Unifi SSH Host/load_avg_1mn,{$UNIFI_ALERT_PERIOD})=1'
discovery_rules:
-
uuid: c63e03a538104cdebad4f428337e2952
name: 'Fan Discovery'
type: DEPENDENT
key: fan_discovery
delay: '0'
item_prototypes:
-
uuid: b84302d8102645eb882c4cec6131dddc
name: 'Fan Level'
type: DEPENDENT
key: '_[{#FAN_LEVEL_KEY_NAME}]'
delay: '0'
units: '%'
preprocessing:
-
type: JSONPATH
parameters:
- $.fan_level
master_item:
key: 'mca-dump-short.sh["-d","{HOST.CONN}", "-u", "{$UNIFI_USER}", "-i", "{$UNIFI_SSH_PRIV_KEY_PATH}", "-t", "SWITCH", "-p", "{$UNIFI_SSHPASS_PASSWORD_PATH}" ]'
tags:
-
tag: Application
value: Power
master_item:
key: 'mca-dump-short.sh["-d","{HOST.CONN}", "-u", "{$UNIFI_USER}", "-i", "{$UNIFI_SSH_PRIV_KEY_PATH}", "-t", "SWITCH_FEATURE_DISCOVERY", "-p", "{$UNIFI_SSHPASS_PASSWORD_PATH}" ]'
lld_macro_paths:
-
lld_macro: '{#FAN_LEVEL_KEY_NAME}'
path: $.fan_level_key_name
preprocessing:
-
type: JSONPATH
parameters:
- '$[?(@.has_fan=="true")]'
-
uuid: 3440ec98490a4b40bcc1dddca0955cb8
name: 'POE Discovery'
Expand Down

0 comments on commit d1d7fec

Please sign in to comment.