misc Package
misc Package
filter Module
Helper functions for some filtering, like for user based
-
shinken.misc.filter.only_related_to(lst, user)[source]
md5crypt Module
md5crypt.py - Provides interoperable MD5-based crypt() function
SYNOPSIS
import md5crypt.py
cryptedpassword = md5crypt.md5crypt(password, salt);
DESCRIPTION
unix_md5_crypt() provides a crypt()-compatible interface to the
rather new MD5-based crypt() function found in modern operating systems.
It’s based on the implementation found on FreeBSD 2.2.[56]-RELEASE and
contains the following license in it:
“THE BEER-WARE LICENSE” (Revision 42):
<
phk@login.dknet.dk> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
apache_md5_crypt() provides a function compatible with Apache’s
.htpasswd files. This was contributed by Bryan Hart <bryan@eai.com>.
-
shinken.misc.md5crypt.apache_md5_crypt(pw, salt)[source]
-
shinken.misc.md5crypt.md5crypt(pw, salt, magic=None)
-
shinken.misc.md5crypt.to64(v, n)[source]
-
shinken.misc.md5crypt.unix_md5_crypt(pw, salt, magic=None)[source]
perfdata Module
-
class shinken.misc.perfdata.Metric(s)[source]
-
class shinken.misc.perfdata.PerfDatas(s)[source]
-
shinken.misc.perfdata.guess_int_or_float(val)[source]
regenerator Module
-
class shinken.misc.regenerator.Regenerator[source]
Bases: object
-
all_done_linking(inst_id)[source]
-
before_after_hook(brok, obj)[source]
This can be used by derived classes to compare the data in the brok
with the object which will be updated by these data. For example,
it is possible to find out in this method whether the state of a
host or service has changed.
-
create_reversed_list()[source]
-
linkify_a_command(o, prop)[source]
-
linkify_a_timeperiod(o, prop)[source]
-
linkify_a_timeperiod_by_name(o, prop)[source]
-
linkify_commands(o, prop)[source]
-
linkify_contacts(o, prop)[source]
-
linkify_dict_srv_and_hosts(o, prop)[source]
-
linkify_host_and_hosts(o, prop)[source]
-
load_external_queue(from_q)[source]
-
load_from_scheduler(sched)[source]
-
manage_brok(brok)[source]
Look for a manager function for a brok, and call it
-
manage_host_check_result_brok(b)[source]
-
manage_host_next_schedule_brok(b)[source]
-
manage_initial_broker_status_brok(b)[source]
-
manage_initial_broks_done_brok(b)[source]
-
manage_initial_command_status_brok(b)[source]
-
manage_initial_contact_status_brok(b)[source]
-
manage_initial_contactgroup_status_brok(b)[source]
-
manage_initial_host_status_brok(b)[source]
-
manage_initial_hostgroup_status_brok(b)[source]
-
manage_initial_poller_status_brok(b)[source]
-
manage_initial_reactionner_status_brok(b)[source]
-
manage_initial_receiver_status_brok(b)[source]
-
manage_initial_scheduler_status_brok(b)[source]
-
manage_initial_service_status_brok(b)[source]
-
manage_initial_servicegroup_status_brok(b)[source]
-
manage_initial_timeperiod_status_brok(b)[source]
-
manage_program_status_brok(b)[source]
-
manage_service_check_result_brok(b)[source]
-
manage_service_next_schedule_brok(b)[source]
-
manage_update_broker_status_brok(b)[source]
-
manage_update_host_status_brok(b)[source]
-
manage_update_poller_status_brok(b)[source]
-
manage_update_program_status_brok(b)[source]
-
manage_update_reactionner_status_brok(b)[source]
-
manage_update_receiver_status_brok(b)[source]
-
manage_update_scheduler_status_brok(b)[source]
-
manage_update_service_status_brok(b)[source]
-
update_element(e, data)[source]
-
want_brok(brok)[source]
sorter Module
Helper functions for some sorting
-
shinken.misc.sorter.hst_srv_sort(s1, s2)[source]
-
shinken.misc.sorter.last_state_change_earlier(s1, s2)[source]
-
shinken.misc.sorter.worse_first(s1, s2)[source]
termcolor Module
ANSII Color formatting for output in terminal.
-
shinken.misc.termcolor.colored(text, color=None, on_color=None, attrs=None)[source]
Colorize text.
- Available text colors:
- red, green, yellow, blue, magenta, cyan, white.
- Available text highlights:
- on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
- Available attributes:
- bold, dark, underline, blink, reverse, concealed.
- Example:
- colored(‘Hello, World!’, ‘red’, ‘on_grey’, [‘blue’, ‘blink’])
colored(‘Hello, World!’, ‘green’)
-
shinken.misc.termcolor.cprint(text, color=None, on_color=None, attrs=None, **kwargs)[source]
Print colorize text.
It accepts arguments of print function.