This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
""" | |
This script will dump host stats from your Nagios4 status.dat as JSON. | |
You can put this in your /usr/lib/cgi-bin/nagios4 directory and chmod +x this file, | |
then, to access it remotely use python requests: | |
r = requests.get('https://nagiosinstall-location.com/nagios4/cgi-bin/status2json.py', auth=HTTPDigestAuth(user,pass)) | |
print(r.json()) | |
You might need to add .py to your http.conf cgi handlers. |