Posts

Posts mit dem Label "mailq" werden angezeigt.

CloudRadar - mailq check with Python

Bild
To create a custom check for CloudRadar to check you mailq size. This check allows to create a custom check at CloudRadar to check the mailq size. This is only about the number of mails in the queue. If this exceeds a limit, a warning or an error will be send to CloudRadar. #!/usr/bin/env python import requests import json import sys import subprocess # # Mailqueue check # # Your token of the custom check token = 'XXXXXXX' # Name of the custom check. Needs to be created on my.cloduradar.io first! check = 'mailq' # URL of cloudradars data hub. No need to change. url = "https://hub.cloudradar.io/cct/" # Max numbers of mails in queue before warning threshold = 4 alerts = [] warnings = [] payload = dict() p = subprocess.Popen('mailq | grep -c "^[A-F0-9]"', stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() payload[check+'.mailq'] = int(output) if int(output) > threshold:   ale...