Records when an outage has taken place, including all the things that have gone down and the dates when it was resolved etc
Records which sites are effected by the outage
Records when it has been accessed and the code returned
This will get big very quickly, so there will need to be a database purge script written. This shouldn’t be done on save because the normal monitoring system should do no extra work.
Using a UUID rather than an auto-increment for the pk
Returns a json object containing details for each site being monitored in this particular group
Show monitoring results for all systems being monitored.
This doesn’t do any parsing, it just gets the latest information from the database. A seperate script does the db update work.
Shows details of an outage, or the current outage if there is one
Pass it a time in seconds and it returns a human readable string showing the hours, minutes and seconds
http://code.activestate.com/recipes/576888-format-a-number-as-an-ordinal/
Converts zero or a postive integer (or their string representations) to an ordinal value.
>>> for i in range(1,13):
... ordinal(i)
...
u'1st'
u'2nd'
u'3rd'
u'4th'
u'5th'
u'6th'
u'7th'
u'8th'
u'9th'
u'10th'
u'11th'
u'12th'
>>> for i in (100, '111', '112',1011):
... ordinal(i)
...
u'100th'
u'111th'
u'112th'
u'1011th'
Takes an object obj and puts the pagination links on screen.
This is an inclusion tag rather than just calling the fragment because it is totally generic - it uses {{obj}} rather than the name of the variable.