Programming

Hello world plugin for Nagios in Python

Nagios looks at 1) return codes and 2) output to stdout. This is the hello world of Nagios plugins, written in Python: check_helloworld.py: #!/usr/bin/env python   # optparse is Python 2.3 – 2.6, deprecated in 2.7 # For 2.7+ use http://docs.python.org/library/argparse.html#module-argparse from optparse import OptionParser   # CONSTANTS FOR RETURN CODES UNDERSTOOD BY NAGIOS # …

Hello world plugin for Nagios in Python Read More »

Installing pip and virtualenv on Mac

These instructions show how to install pip and virtualevn on a Mac running Snow Leopard 10.6.8 and using Python 2.7. I used this to install Django 1.3.1 (installation instructions included). Installing pip (skip if you have pip installed) First make sure you have either setuptools or distribute installed. Please consult your operating system’s package manager …

Installing pip and virtualenv on Mac Read More »

Using CORS instead of JSONP to make cross site requests

Introduction to CORS CORS (Cross Origin Resource Sharing) is a mechanism specifies by W3C (draft), for allowing browsers to make cross origin requests for resources on other domains under certain conditions. It’s related to JSONP because it solves a similar problem, namely loading data from one domain, into a web application running on a different …

Using CORS instead of JSONP to make cross site requests Read More »