You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 3, 2020. It is now read-only.
- VM snapshots are now created before scheduling downtimes, downtime
default timeframe changed to 4 hours (see issue #35)
- vlog behavior altered to be more intelligent (for details see issue
#36))
- Implemented function for scheduling downtime for Nagios/Icinga
hostgroups (see issue #37) [parameters -g / --downtime-hostgroup,
satprep_prepare_maintenance.py]
- Some minor fixes
monOpts.add_option("-u", "--monitoring-url", dest="URL", metavar="URL", default="http://localhost/icinga", help="defines the default Nagios/Icinga/Thruk/Shinken URL to use, might be overwritten by custom system keys (default: http://localhost/icinga)")
430
457
#-t / --hours
431
-
monOpts.add_option("-t", "--hours", action="store", dest="hours", default="2", metavar="HOURS", help="sets the time period in hours hosts should be scheduled for downtime (default: 2)")
458
+
monOpts.add_option("-t", "--hours", action="store", dest="hours", default="4", metavar="HOURS", help="sets the time period in hours hosts should be scheduled for downtime (default: 4)")
monOpts.add_option("-A", "--user-agent", action="store", default="", metavar="AGENT", dest="userAgent", help="sets a custom HTTP user agent")
463
+
#-g / --downtime-hostgroup
464
+
monOpts.add_option("-g", "--downtime-hostgroup", action="append", type="string", default=[], metavar="HOSTGROUP", dest="downtimeHostgroups", help="defines hostgroups which should be scheduled for downtime. NOTE: This disables scheduling downtime for particular hosts.")
LOGGER.error("Got HTTP status code "+str(r.status_code) +" instead of 200 while scheduling downtime for host '"+host+"'. Check URL and logon credentials!")
172
+
LOGGER.error("Got HTTP status code "+str(r.status_code) +" instead of 200 while (un)scheduling downtime for host '"+host+"'. Check URL and logon credentials!")
173
173
returnFalse
174
174
else:
175
175
if"error"inr.text.lower(): LOGGER.error("Unable to (un)schedule downtime for host '"+host+"' - please run again with -d / --debug and check HTML output! (does this host exist?!)")
LOGGER.error("Got HTTP status code "+str(r.status_code) +" instead of 200 while scheduling downtime for hostgroup '"+hostgroup+"'. Check URL and logon credentials!")
215
+
returnFalse
216
+
else:
217
+
if"error"inr.text.lower(): LOGGER.error("Unable to schedule downtime for hostgroup '"+hostgroup+"' - please run again with -d / --debug and check HTML output! (does this host exist?!)")
218
+
else:
219
+
print"Successfully scheduled downtime for hostgroup '"+hostgroup+"'"
Copy file name to clipboardExpand all lines: satprep_wa_vcvms.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ def parse_options(args=None):
204
204
It is also possible to create an authfile (permissions 0600) for usage with this script (parameters -a/-A). The first line needs to contain the username, the second line should consist of the appropriate password.
205
205
If you're not defining variables or an authfile you will be prompted to enter your login information.
206
206
Checkout the GitHub wiki for further information: https://github.com/stdevel/satprep/wiki'''
207
-
parser=OptionParser(description=desc, version="%prog version 0.3")
207
+
parser=OptionParser(description=desc, version="%prog version 0.3.3")
0 commit comments