I've started looking into how to quieten down the warnings without
losing all the info.

The monitors are called very fequently (maybe once or twice per minute)
So it's vital that sending an e-mail is not needlessly repeated.

I was hoping to use the previous_status hash which is passed in.

I tried comparing hashes, but this shows differences, for example:

previous
{"ldap-services"=>{"href"=>"../logs/public-ldap-services",
"mtime"=>"2016-04-05 00:15:43 +0100", "level"=>"warning",
"data"=>"Last updated: 2016-04-05 00:15:43 +0100 (more than 1.5 hours
old)"}}

current
{"ldap-services"=>{:href=>"../logs/public-ldap-services",
:mtime=>2016-04-05 00:15:43 +0100, :level=>"warning", :data=>"Last
updated: 2016-04-05 00:15:43 +0100 (more than 1.5 hours old)"}}

The difference is that the input hash uses strings as hash keys,
whereas the output hash uses symbols.

It looks like monitor.rb is using mainly strings, whereas
public_json.rb mainly uses symbols.
This makes it harder to detect actual changes.

Is there any reason not to use symbols for hash keys throughout?

Reply via email to