Skip to content

Instantly share code, notes, and snippets.

@mostlyjason
mostlyjason / nagios2loggly.sh
Created February 9, 2015 21:20
Read from Nagios perfdata file and send bulk data to Loggly as JSON
#!/bin/bash
## nagios2loggly.sh
## Andy Mayhew <andy@loggly.com>
##
## Read from Nagios perfdata file and send bulk data.
##
## Setup as parallel performance data processor.
## Create /etc/nagios3/conf.d/nagios2loggly.cfg
## define command{
@mostlyjason
mostlyjason / gist:01d9af091a29d1c1975d
Created October 24, 2014 20:36
ProcessMonitor.py
import psutil
import simplejson
import time
import urllib2
# Sends the CPU and memory usage stats to Loggly. Sends both a machine total and per process.
def log():
""""""
proc_dict = {}