Skip to content

Instantly share code, notes, and snippets.

@alexwright
alexwright / status2json.py
Last active September 8, 2022 20:50
Parse the Nagios status.dat and poop out some JSON
#!/usr/bin/env python
import re
import json
STATUS_FILE_PATH = "/var/cache/nagios3/status.dat"
def read_status():
hosts = {}
services = {}