mirror of
https://github.com/bashclub/checkmk-monitoring-plugins.git
synced 2024-11-07 18:01:58 +01:00
Create check_release_info
This commit is contained in:
parent
1ff06c7239
commit
0c62ba782a
14
release-info/check_release_info
Normal file
14
release-info/check_release_info
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
|
||||
ok_list = ['bullseye', 'bookworm', 'trixie', 'forky', 'jammy', 'focal']
|
||||
warn_list = ['buster', 'bionic', 'xenial']
|
||||
|
||||
cmd = ["/usr/bin/lsb_release", "-ircs"]
|
||||
stdout, stderr = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()
|
||||
dist, version, codename, null = stdout.decode('utf-8').split('\n')
|
||||
|
||||
state: int = 0 if codename in ok_list else (1 if codename in warn_list else 2)
|
||||
|
||||
print (f'{state} "Distribution Info" - {dist} {version} {codename}')
|
Loading…
Reference in New Issue
Block a user