Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Sinagios – a Very Simple RESTful API for Nagios Downtime

DZone's Guide to

Sinagios – a Very Simple RESTful API for Nagios Downtime

· DevOps Zone
Free Resource

The Nexus Suite is uniquely architected for a DevOps native world and creates value early in the development pipeline, provides precise contextual controls at every phase, and accelerates DevOps innovation with automation you can trust. Read how in this ebook.

Last week I spent a bit of time scratching an itch I’ve had with doing maintenance. We use Nagios for our monitoring (without any addons, plugins or frontends) and scheduling downtime is a pain. Not only that, but deleting downtime is impossible short of screenscraping or (shock) actually clicking in the user interface. When I’m done doing maintenance I want to delete all the downtime (regardless of if the window will naturally come to an end soon or not) because I want notifications to start sending immediately if there is a real problem.

Naturally I did some diligence beforehand as this is hardly a topic that hasn’t come up before, and sure enough some guy has implemented something similar but in Python. Nevertheless I wanted to do some coding so I present to you Sinagios.

It’s a pretty simple Sinatra app (and thus obviously Ruby), in fact it only does three things:

  • Lists currently scheduled downtime
  • Schedules new downtime
  • Deletes downtime

I also got to dive into a bit of RSpec and Rack-test since I’ve mostly gotten away with Test::Unit before and non-web-facing systems so it was an interesting change. Fairly soon I’ll be uploading a spec file for making RPMs and adding some Puppet recipes to deploy it so that it’s a more complete set of stuff.

Hopefully someone will find it useful!

The DevOps Zone is brought to you in partnership with Sonatype Nexus.  See how the Nexus platform infuses precise open source component intelligence into the DevOps pipeline early, everywhere, and at scale. Read how in this ebook

Topics:

Published at DZone with permission of Oliver Hookins, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}