misc Package
Diagrams
Simple PerfDatas class diagram :
Simple DataManager class diagram :
Simple Regenerator class diagram :
Simple Metric class diagram :
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
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.