Skip to content

Commit

Permalink
Exclude Docker Volumes from Storage Check (#6)
Browse files Browse the repository at this point in the history
* exclude docker volumes

* added missing import

* Update check_synology.py

* Update check_synology.py

* additional filter

possible volume names are 
/volume'X'/@docker/id/'something'/
and
/volume'X'/@docker <- this needs another regex check

alternative : 
look for "/volume.+/@DocKe.+"

Might lead to false positives?

* updated to wernerfred recommendations
  • Loading branch information
Byolock authored Apr 15, 2020
1 parent 3898508 commit 9c13749
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion check_synology.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import argparse
import sys
import math
import re

AUTHOR = "Frederic Werner"
VERSION = 0.1
Expand Down Expand Up @@ -123,7 +124,7 @@ def exitCode():
perfdata = '|'
for i in range(1,256,1):
storage_name = snmpget('1.3.6.1.2.1.25.2.3.1.3.' + str(i))
if storage_name.startswith("/volume"):
if re.match("/volume(?!.+/@docker.*)", storage_name) :
allocation_units = snmpget('1.3.6.1.2.1.25.2.3.1.4.' + str(i))
size = snmpget('1.3.6.1.2.1.25.2.3.1.5.' + str(i))
used = snmpget('1.3.6.1.2.1.25.2.3.1.6.' + str(i))
Expand Down

0 comments on commit 9c13749

Please sign in to comment.