«

Perl script to add/remove Maintenance

By jbayer - Last updated: Tuesday, May 1, 2012 - Save & Share - 2 Comments

I found a perl script to add/remove a single host to maintenance in Zabbix.  I needed more, the ability to add multiple hosts to a single maintenance, as well as an entire group.

The script I started with can be found at:

http://www.zabbix.org/wiki/Perl_script_to_add/remove_Maintenance

The attached file is my modified version.  The changes I made are:

  1. Change the curl cmd to a variable. This so if you need to go to a secure site, you can add whatever options you need to access it
  2. Added -t option to specify maintenance type without data collection
  3. Added -g option to specify a group instead of or in addition to a host
  4. Added ability to specify multiple hosts and groups
  5. Converted from the Getopt::Std to Getopt::Long
  6. Added long options –host, –group, –help, –remove

  maint.tar.gz (2.9 KiB, 441 hits)

Posted in Administration, Perl, Zabbix • • Top Of Page
1,089 views

2 Responses to “Perl script to add/remove Maintenance”

Comment from Scott
Time September 24, 2013 at 4:15 pm

You may want to scrub URLs and credentials from your tarballed script.

Comment from jbayer
Time October 2, 2013 at 5:22 pm

Thank you.

JBB

Write a comment

asd