Agnus Dei (jackal) wrote,
Agnus Dei
jackal

Nagios Plugin/Script for Alerting on AWS Event Data (reboots/maintenance)

I published my script called "get_as_events.pl" to github here.

It queries AWS for your instances and looks for any instance that has an event description that is not empty and reports it back to you. If you pass it a "--nagios" flag, it runs in Nagios mode as Nagios plugin.

https://github.com/jackal242/brads_scripts/blob/master/get_aws_events.pl

Example Usage:
[scripts]$ ./get_aws_events.pl 
2015-08-12T10 hostname-01          i-aaaa1111 system-maintenance   [Completed] Your instance will experience a loss of network connectivity.
2015-08-12T10 hostname-02          i-bbbb2222 system-maintenance   [Completed] Your instance will experience a loss of network connectivity.
2015-08-23T07 hostname-03          i-cccc3333 system-reboot        [Completed] scheduled reboot
2015-08-23T07 hostname-04          i-dddd4444 system-reboot        [Completed] scheduled reboot
2015-08-23T11 hostname-05          i-eeee5555 system-reboot        [Completed] scheduled reboot
2015-08-23T13 hostname-06          i-ffff6666 system-reboot        [Completed] scheduled reboot


[scripts]$ ./get_aws_events.pl -nagios
0 AWS Events to report.



Enjoy.

UPDATE:  I rewrote the script to only use "aws" cli commands. 
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 0 comments