Utilizing the [``nagiosplugin``](https://pypi.python.org/pypi/nagiosplugin/) python module would simplify maintaining the code.