X7ROOT File Manager
Current Path:
/usr/local/nagios/plugins
usr
/
local
/
nagios
/
plugins
/
📁
..
📄
check-vps-cxs-log.ini
(214 B)
📄
check-vps-cxs-log.sh
(4.22 KB)
📄
check_3ware-raid.pl
(10.93 KB)
📄
check_aacraid.py
(4.62 KB)
📄
check_cl_license
(943 B)
📄
check_cplicense
(268 B)
📄
check_csf
(3.78 KB)
📄
check_eximq
(3.16 KB)
📄
check_if_ips.py
(3.88 KB)
📄
check_mdadm
(771 B)
📄
check_megaraid_sas
(6.98 KB)
📄
check_mem.pl
(12.85 KB)
📄
check_newbackup
(7.08 KB)
📄
check_puppet
(4.35 KB)
📄
check_ro_fs.sh
(530 B)
📄
check_spamd
(6.74 KB)
📁
nc-smart-data-exporter
Editing: check_cl_license
#!/usr/bin/env python3 # version 0.1, 2013/10/16 # writen by Eduard N. # Modify by Ihor Bilyi, Phantom team, 07/2022 import os import re from subprocess import Popen, PIPE # State Nagios STATE_OK = 0 STATE_WARNING = 1 STATE_CRITICAL = 2 STATE_UNKNOWN = 3 cldetect = '/usr/bin/cldetect' ok_pattern = re.compile(r"^OK$") invalid_pattern = re.compile(r"^No valid license found$") if os.path.isfile(cldetect): result, err = Popen([cldetect, '--check-license'], stdout=PIPE).communicate() result = result.decode('utf-8') if ok_pattern.search(result): print("CL license OK") exit(STATE_OK) elif invalid_pattern.search(result): print("Critical. No CL license found") exit(STATE_CRITICAL) else: print(result) print(err.decode('utf-8')) exit(STATE_UNKNOWN) else: print("OK. Binary file cldetect not found -> no CL on host, CL license not needed") exit(STATE_OK)
Upload File
Create Folder