shinken Package

shinken Package

acknowledge Module

class shinken.acknowledge.Acknowledge(ref, sticky, notify, persistent, author, comment, end_time=0)[source]

Allows you to acknowledge the current problem for the specified service. By acknowledging the current problem, future notifications (for the same servicestate) are disabled.

id = 1
properties = {'comment': None, 'author': None, 'sticky': None, 'end_time': None, 'id': None, 'notify': None}

action Module

class shinken.action.Action[source]

Bases: shinken.action.__Action

execute__(force_shell=False)[source]
kill__()[source]
shinken.action.no_block_read(output)[source]

autoslots Module

The AutoSlots Class is a MetaClass: it manages how other classes are created (Classes, not instances of theses classes). Here it’s role is to create the __slots__ list of the class with all properties of Class.properties and Class.running_properties so we do not have to add manually all properties to the __slots__ list when we add a new entry

class shinken.autoslots.AutoSlots[source]

Bases: type

basemodule Module

This python module contains the class BaseModule that shinken modules will subclass

class shinken.basemodule.BaseModule(mod_conf)[source]

Bases: object

This is the base class for the shinken modules. Modules can be used by the different shinken daemons/services for different tasks. Example of task that a shinken module can do:

  • load additional configuration objects.
  • recurrently save hosts/services status/perfdata informations in different format.
  • ...
clear_queues(manager)[source]

Release the resources associated to the queues of this instance

create_queues(manager=None)[source]

The manager is None on android, but a true Manager() elsewhere Create the shared queues that will be used by shinken daemon process and this module process. But clear queues if they were already set before recreating new one.

do_loop_turn()[source]

For external modules only: implement in this method the body of you main loop

do_stop()[source]

Called just before the module will exit Put in this method all you need to cleanly release all open resources used by your module

get_name()[source]
has(prop)[source]

The classic has: do we have a prop or not?

init()[source]

Handle this module “post” init ; just before it’ll be started. Like just open necessaries file(s), database(s), or whatever the module will need.

main()[source]

module “main” method. Only used by external modules.

manage_brok(brok)[source]

Request the module to manage the given brok. There a lot of different possible broks to manage.

manage_signal(sig, frame)[source]
set_exit_handler(sigs=None)
set_loaded_into(daemon_name)[source]
set_proctitle(name)[source]
set_signal_handler(sigs=None)[source]
start()[source]
stop_process()[source]

Request the module process to stop and release it

want_brok(b)[source]
work()

module “main” method. Only used by external modules.

class shinken.basemodule.ModulePhases[source]

TODO: Add some comment about this class for the doc

CONFIGURATION = 1
LATE_CONFIGURATION = 2
RETENTION = 8
RUNNING = 4

bin Module

borg Module

class shinken.borg.Borg[source]

Bases: object

Here is the new-style Borg (not much more complex then the “old-style”)

brok Module

class shinken.brok.Brok(type, data)[source]

A Brok is a piece of information exported by Shinken to the Broker. Broker can do whatever he wants with it.

id = 0
my_type = 'brok'
prepare()[source]

check Module

class shinken.check.Check(status, command, ref, t_to_go, dep_check=None, id=None, timeout=10, poller_tag='None', reactionner_tag='None', env={}, module_type='fork', from_trigger=False, dependency_check=False)[source]

Bases: shinken.action.Action

ODO: Add some comment about this class for the doc

check_time
check_type
copy_shell()[source]

return a copy of the check but just what is important for execution So we remove the ref and all

dep_check
depend_on
env
execution_time
exit_status
from_trigger
get_id()[source]
get_return_from(c)[source]
internal
is_a
is_dependent()[source]
is_launchable(t)[source]
long_output
module_type
my_type = 'check'
output
perf_data
poller_tag
properties = {'check_type': <shinken.property.IntegerProp object at 0x7f004a056090>, 'exit_status': <shinken.property.IntegerProp object at 0x7f0049a0e7d0>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f004a056f90>, 's_time': <shinken.property.FloatProp object at 0x7f004a056150>, 'check_time': <shinken.property.IntegerProp object at 0x7f004a1ba690>, 'long_output': <shinken.property.StringProp object at 0x7f0049a0e350>, 'state': <shinken.property.IntegerProp object at 0x7f0049a0e610>, 'internal': <shinken.property.BoolProp object at 0x7f004a056750>, 'u_time': <shinken.property.FloatProp object at 0x7f0049939850>, 'env': <shinken.property.StringProp object at 0x7f004a056950>, 'ref': <shinken.property.IntegerProp object at 0x7f004a1ba5d0>, 'from_trigger': <shinken.property.BoolProp object at 0x7f004a056fd0>, 'status': <shinken.property.StringProp object at 0x7f0049a0e590>, 'execution_time': <shinken.property.FloatProp object at 0x7f00499391d0>, 'worker': <shinken.property.StringProp object at 0x7f004a056f50>, 't_to_go': <shinken.property.IntegerProp object at 0x7f004a1ba9d0>, 'module_type': <shinken.property.StringProp object at 0x7f004a056f10>, 'dep_check': <shinken.property.StringProp object at 0x7f004a1bad50>, '_in_timeout': <shinken.property.BoolProp object at 0x7f0049ec5fd0>, 'type': <shinken.property.StringProp object at 0x7f0049ec5cd0>, 'depend_on': <shinken.property.StringProp object at 0x7f004a1baa10>, 'is_a': <shinken.property.StringProp object at 0x7f0049ec5b50>, 'poller_tag': <shinken.property.StringProp object at 0x7f004a056110>, 'output': <shinken.property.StringProp object at 0x7f0049a0e510>, 'perf_data': <shinken.property.StringProp object at 0x7f004a056450>}
reactionner_tag
ref
s_time
set_type_active()[source]
set_type_passive()[source]
state
status
t_to_go
type
u_time
worker

commandcall Module

class shinken.commandcall.CommandCall(commands, call, poller_tag='None', reactionner_tag='None')[source]

Bases: shinken.commandcall.DummyCommandCall

This class is use when a service, contact or host define a command with args.

args
call
command
get_command_and_args()[source]

We want to get the command and the args with ! splitting. but don’t forget to protect against the ! to do not split them

get_name()[source]
id = 0
is_valid()[source]
late_linkify_with_command(commands)[source]
module_type
my_type = 'CommandCall'
poller_tag
properties = {'poller_tag': <shinken.property.StringProp object at 0x7f0049dd4110>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0049dd4390>, 'valid': <shinken.property.BoolProp object at 0x7f0049dd4490>, 'call': <shinken.property.StringProp object at 0x7f0049dd4150>, 'timeout': <shinken.property.IntegerProp object at 0x7f0049dd4610>, 'late_relink_done': <shinken.property.BoolProp object at 0x7f0049dd4590>, 'command': <shinken.property.StringProp object at 0x7f0049dd45d0>, 'args': <shinken.property.StringProp object at 0x7f0049dd4a10>, 'module_type': <shinken.property.StringProp object at 0x7f0049dd4a90>}
reactionner_tag
timeout
valid
class shinken.commandcall.DummyCommandCall[source]

Bases: object

Ok, slots are fun: you cannot set the __autoslots__ on the same class you use, fun isn’t it? So we define* a dummy useless class to get such :)

comment Module

class shinken.comment.Comment(ref, persistent, author, comment, comment_type, entry_type, source, expires, expire_time)[source]
id = 1
properties = {'comment': None, 'source': None, 'entry_time': None, 'comment_type': None, 'author': None, 'expire_time': None, 'entry_type': None, 'can_be_deleted': None, 'expires': None, 'persistent': None}

complexexpression Module

class shinken.complexexpression.ComplexExpressionFactory(ctx='hostgroups', grps=None, all_elements=None)[source]

Bases: object

eval_cor_pattern(pattern)[source]
find_object(pattern)[source]
class shinken.complexexpression.ComplexExpressionNode[source]

Bases: object

is_valid()[source]
resolve_elements()[source]

contactdowntime Module

class shinken.contactdowntime.ContactDowntime(ref, start_time, end_time, author, comment)[source]
cancel()[source]
check_activation()[source]
enter()[source]
exit()[source]
id = 1
in_scheduled_downtime()[source]
properties = {'comment': None, 'author': None, 'start_time': None, 'is_in_effect': None, 'end_time': None, 'can_be_deleted': None}

daemon Module

daterange Module

class shinken.daterange.CalendarDaterange(syear, smon, smday, swday, swday_offset, eyear, emon, emday, ewday, ewday_offset, skip_interval, other)[source]

Bases: shinken.daterange.Daterange

get_start_and_end_time(ref=None)[source]
class shinken.daterange.Daterange(syear, smon, smday, swday, swday_offset, eyear, emon, emday, ewday, ewday_offset, skip_interval, other)[source]
get_min_from_t(t)[source]
get_min_sec_from_morning()[source]
get_min_sec_out_from_morning()[source]
classmethod get_month_by_id(id)[source]
classmethod get_month_id(month)[source]
get_next_future_timerange_invalid(t)[source]
get_next_future_timerange_valid(t)[source]
get_next_invalid_day(t)[source]
get_next_invalid_time_from_t(t)[source]
get_next_valid_day(t)[source]
get_next_valid_time_from_t(t)[source]
get_start_and_end_time(ref=None)[source]
classmethod get_weekday_by_id(id)[source]
classmethod get_weekday_id(weekday)[source]
is_correct()[source]
is_time_day_invalid(t)[source]
is_time_day_valid(t)[source]
is_time_valid(t)[source]
months = {'march': 3, 'august': 8, 'september': 9, 'december': 12, 'june': 6, 'july': 7, 'november': 11, 'february': 2, 'october': 10, 'may': 5, 'january': 1, 'april': 4}
weekdays = {'monday': 0, 'tuesday': 1, 'friday': 4, 'wednesday': 2, 'thursday': 3, 'sunday': 6, 'saturday': 5}
class shinken.daterange.MonthDateDaterange(syear, smon, smday, swday, swday_offset, eyear, emon, emday, ewday, ewday_offset, skip_interval, other)[source]

Bases: shinken.daterange.Daterange

get_start_and_end_time(ref=None)[source]
class shinken.daterange.MonthDayDaterange(syear, smon, smday, swday, swday_offset, eyear, emon, emday, ewday, ewday_offset, skip_interval, other)[source]

Bases: shinken.daterange.Daterange

get_start_and_end_time(ref=None)[source]
class shinken.daterange.MonthWeekDayDaterange(syear, smon, smday, swday, swday_offset, eyear, emon, emday, ewday, ewday_offset, skip_interval, other)[source]

Bases: shinken.daterange.Daterange

get_start_and_end_time(ref=None)[source]
is_correct()[source]
class shinken.daterange.StandardDaterange(day, other)[source]

Bases: shinken.daterange.Daterange

get_start_and_end_time(ref=None)[source]
is_correct()[source]
class shinken.daterange.Timerange(entry)[source]
get_first_sec_out_from_morning()[source]
get_sec_from_morning()[source]
is_time_valid(t)[source]
class shinken.daterange.WeekDayDaterange(syear, smon, smday, swday, swday_offset, eyear, emon, emday, ewday, ewday_offset, skip_interval, other)[source]

Bases: shinken.daterange.Daterange

get_start_and_end_time(ref=None)[source]
shinken.daterange.find_day_by_offset(year, month, offset)[source]
shinken.daterange.find_day_by_weekday_offset(year, month, weekday, offset)[source]

db Module

class shinken.db.DB(table_prefix='')[source]

Bases: object

DB is a generic class for SQL Database

create_insert_query(table, data)[source]

Create a INSERT query in table with all data of data (a dict)

create_update_query(table, data, where_data)[source]

Create a update query of table with data, and use where data for the WHERE clause

fetchone()[source]

Just get an entry

stringify(val)[source]

Get a unicode from a value

db_mysql Module

class shinken.db_mysql.DBMysql(host, user, password, database, character_set, table_prefix='', port=3306)[source]

Bases: shinken.db.DB

DBMysql is a MySQL access database class

connect_database()[source]

Create the database connection TODO: finish (begin :) ) error catch and conf parameters... Import to catch exception

execute_query(query, do_debug=False)[source]

Just run the query TODO: finish catch

db_oracle Module

class shinken.db_oracle.DBOracle(user, password, database, table_prefix='')[source]

Bases: shinken.db.DB

Manage connection and query execution against Oracle databases.

connect_database()[source]

Create the database connection TODO: finish (begin :) ) error catch and conf parameters...

execute_query(query)[source]

Execute a query against an Oracle database.

db_sqlite Module

class shinken.db_sqlite.DBSqlite(db_path, table_prefix='')[source]

Bases: shinken.db.DB

DBSqlite is a sqlite access database class

connect_database()[source]

Create the database connection

execute_query(query)[source]

Just run the query

dependencynode Module

class shinken.dependencynode.DependencyNode[source]

Bases: object

get_reverse_state(state)[source]
get_state()[source]
is_valid()[source]
list_all_elements()[source]
switch_zeros_of_values()[source]
class shinken.dependencynode.DependencyNodeFactory[source]

Bases: object

eval_cor_pattern(pattern, hosts, services)[source]
find_object(pattern, hosts, services)[source]

dispatcher Module

This is the class of the dispatcher. Its role is to dispatch configurations to other elements like schedulers, reactionner, pollers, receivers and brokers. It is responsible for high availability part. If an element dies and the element type has a spare, it sends the config of the dead one to the spare

class shinken.dispatcher.Dispatcher(conf, arbiter)[source]
check_alive()[source]
check_bad_dispatch()[source]
check_dispatch()[source]
dispatch()[source]
get_scheduler_ordered_list(r)[source]

downtime Module

class shinken.downtime.Downtime(ref, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
add_automatic_comment()[source]
cancel()[source]
del_automatic_comment()[source]
enter()[source]
exit()[source]
fill_data_brok_from(data, brok_type)[source]
get_initial_status_brok()[source]
id = 1
in_scheduled_downtime()[source]
properties = {'comment': <shinken.property.StringProp object at 0x7f0048bdbed0>, 'entry_time': <shinken.property.IntegerProp object at 0x7f0048bdbcd0>, 'start_time': <shinken.property.IntegerProp object at 0x7f0048bdbd50>, 'is_in_effect': <shinken.property.BoolProp object at 0x7f0048bdbf10>, 'has_been_triggered': <shinken.property.BoolProp object at 0x7f0048bdbf50>, 'trigger_id': <shinken.property.IntegerProp object at 0x7f0048bdbdd0>, 'duration': <shinken.property.IntegerProp object at 0x7f0048bdbd90>, 'author': <shinken.property.StringProp object at 0x7f0048bdbe90>, 'can_be_deleted': <shinken.property.BoolProp object at 0x7f0048bdbf90>, 'activate_me': <shinken.property.StringProp object at 0x7f0048bdbc50>, 'real_end_time': <shinken.property.IntegerProp object at 0x7f0048bdbe50>, 'end_time': <shinken.property.IntegerProp object at 0x7f0048bdbe10>, 'fixed': <shinken.property.BoolProp object at 0x7f0048bdbd10>}
trigger_me(other_downtime)[source]

easter Module

shinken.easter.dark()[source]
.-.

|_:_|

/(_Y_)

( /M/ )

‘. _.’-/’-‘-‘._
‘: _/.–’[[[[]’–._
‘: /_’ : |::”| : ‘.\
‘: // ./ |oUU| .’ :
‘: _:’..’ \_|___|_/ : :|
‘:. .’ |_[___]_| :.’:
[::\ | : | | : ; : \
‘-‘ /’.| |.’ .;.’ | |_ ‘-‘ : | | .: : | | | | ‘. : | / :. .; |

/ | | :__/ : \

| | : | | ||

/ : : |: / |__| /|

snd | : : :_/_| /’._\ ‘–|_
/___.-/_|-‘
‘-‘
shinken.easter.episode_iv()[source]
shinken.easter.get_coffee()[source]
(
) (
___...(——-)-....___

.-“” ) ( “”-.

.-‘``’|-._ ) _.-|

/ .–.| “”—...........—”“ |

/ / | | | | | |

| |
| |
``| | _/ / /

(__/ /

_..—”“` /`“”—.._

.-‘ / ‘-.

: `-.__ __.-‘ : : ) “”—...—”” ( :

‘._ “–...___...–” _.’
jgs “”–..__ __..–”“/
‘._ “’”—-.....______.....—-“’” _.’
“”–..,,_____ _____,,..–”“
“’”—-“’”
shinken.easter.myip()[source]
shinken.easter.naheulbeuk()[source]
shinken.easter.perdu()[source]

eventhandler Module

class shinken.eventhandler.EventHandler(command, id=None, ref=None, timeout=10, env={}, module_type='fork', reactionner_tag='None')[source]

Bases: shinken.action.Action

check_time
command
copy_shell()[source]
env
execution_time
exit_status
get_id()[source]
get_outputs(out, max_plugins_output_length)[source]
get_return_from(e)[source]
is_a
is_launchable(t)[source]
long_output
module_type
my_type = 'eventhandler'
output
perf_data
properties = {'status': <shinken.property.StringProp object at 0x7f0048b81d90>, 'module_type': <shinken.property.StringProp object at 0x7f0048bc3390>, 'check_time': <shinken.property.IntegerProp object at 0x7f0048bc3250>, 'exit_status': <shinken.property.StringProp object at 0x7f0048b81e90>, 'execution_time': <shinken.property.FloatProp object at 0x7f0048b81e10>, 's_time': <shinken.property.FloatProp object at 0x7f0048bc36d0>, 'worker': <shinken.property.StringProp object at 0x7f0048bc3350>, 'timeout': <shinken.property.IntegerProp object at 0x7f0048bc3590>, 't_to_go': <shinken.property.StringProp object at 0x7f0048b817d0>, 'is_a': <shinken.property.StringProp object at 0x7f0048b81850>, 'long_output': <shinken.property.StringProp object at 0x7f0048b81550>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0048bc3310>, 'command': <shinken.property.StringProp object at 0x7f0048b81b90>, 'u_time': <shinken.property.FloatProp object at 0x7f0048bc3b50>, 'env': <shinken.property.StringProp object at 0x7f0048bc35d0>, 'output': <shinken.property.StringProp object at 0x7f0048b81fd0>, '_in_timeout': <shinken.property.StringProp object at 0x7f0048b81d50>, 'sched_id': <shinken.property.IntegerProp object at 0x7f0048bc3650>, 'type': <shinken.property.StringProp object at 0x7f0048b81c10>, 'perf_data': <shinken.property.StringProp object at 0x7f0048bc3610>}
reactionner_tag
s_time
sched_id
status
t_to_go
timeout
type
u_time
worker

external_command Module

graph Module

class shinken.graph.Graph[source]

Graph is a class to make graph things like DFS checks or accessibility Why use an atomic bomb when a little hammer is enough?

add_edge(from_node, to_node)[source]
add_node(node)[source]
add_nodes(nodes)[source]
dfs_get_all_childs(root)[source]
get_accessibility_packs()[source]
loop_check()[source]

http_client Module

http_daemon Module

load Module

class shinken.load.Load(m=1, initial_value=0)[source]

This class is for having a easy Load calculation without having to send value at regular interval (but it’s more efficient if you do this :) ) and without having a list or other stuff. It’s just an object, an update and a get You can define m: the average for m minutes. The val is the initial value. It’s better if it’s 0 but you can choose.

get_load()[source]
update_load(new_val, forced_interval=None)[source]

log Module

class shinken.log.Log[source]

Shinken logger class, wrapping access to Python logging standard library.

CRITICAL = 50
DEBUG = 10
ERROR = 40
INFO = 20
NOTSET = 0
WARNING = 30
critical(msg, *args, **kwargs)[source]
debug(msg, *args, **kwargs)[source]
error(msg, *args, **kwargs)[source]
get_level()[source]
static get_level_id(lvlName)[source]

Convert a level name (string) to its integer value and vice-versa. Input a level and it will return a name. Raise KeyError when name or level not found

info(msg, *args, **kwargs)[source]
load_obj(object, name_=None)[source]

We load the object where we will put log broks with the ‘add’ method

log(message, format=None, print_it=True)[source]

Old log method, kept for NAGIOS compatibility What strings should not use the new format ??

quit()[source]

Close the local log file at program exit

register_local_log(path, level=None)[source]

The shinken logging wrapper can write to a local file if needed and return the file descriptor so we can avoid to close it.

set_human_format(on=True)[source]

Set the output as human format.

If the optional parameter on is False, the timestamps format will be reset to the default format.

set_level(level)[source]
warning(msg, *args, **kwargs)[source]
shinken.log.cprint(s, color)[source]
shinken.log.is_tty()[source]

macroresolver Module

class shinken.macroresolver.MacroResolver[source]

Bases: shinken.borg.Borg

Please Add a Docstring to describe the class here

get_env_macros(data)[source]
init(conf)[source]
macros = {'TOTALSERVICESCRITICALUNHANDLED': '_get_total_services_critical_unhandled', 'PROCESSSTARTTIME': '_get_process_start_time', 'SHORTDATETIME': '_get_short_date_time', 'TOTALHOSTPROBLEMSUNHANDLED': '_get_total_host_problems_unhandled', 'TOTALSERVICESWARNINGUNHANDLED': '_get_total_services_warning_unhandled', 'TOTALSERVICEPROBLEMSUNHANDLED': '_get_total_service_problems_unhandled', 'DATE': '_get_date', 'TOTALHOSTSUP': '_get_total_hosts_up', 'TOTALSERVICESCRITICAL': '_get_total_services_critical', 'TOTALHOSTSUNREACHABLEUNHANDLED': '_get_total_hosts_unreachable_unhandled', 'TIMET': '_get_timet', 'TOTALHOSTSUNREACHABLE': '_get_total_hosts_unreachable', 'TOTALSERVICESUNKNOWN': '_get_total_services_unknown', 'TOTALHOSTSDOWNUNHANDLED': '_get_total_hosts_unhandled', 'TOTALSERVICESUNKNOWNUNHANDLED': '_get_total_services_unknown_unhandled', 'EVENTSTARTTIME': '_get_events_start_time', 'TOTALSERVICESOK': '_get_total_service_ok', 'TOTALSERVICEPROBLEMS': '_get_total_service_problems', 'TOTALHOSTSDOWN': '_get_total_hosts_down', 'TOTALHOSTPROBLEMS': '_get_total_host_problems', 'LONGDATETIME': '_get_long_date_time', 'TIME': '_get_time', 'TOTALSERVICESWARNING': '_get_total_services_warning'}
my_type = 'macroresolver'
resolve_command(com, data)[source]
resolve_simple_macros_in_string(c_line, data, args=None)[source]

memoized Module

class shinken.memoized.memoized(func)[source]

Bases: object

Decorator that caches a function’s return value each time it is called. If called later with the same arguments, the cached value is returned, and not re-evaluated.

message Module

class shinken.message.Message(id, type, data=None, source=None)[source]

This is a simple message class for communications between actionners and workers

get_data()[source]
get_from()[source]
get_type()[source]
my_type = 'message'
str()[source]

modulesctx Module

modulesmanager Module

class shinken.modulesmanager.ModulesManager(modules_type, modules_path, modules)[source]

Bases: object

This class is use to manage modules and call callback

check_alive_instances()[source]
clear_instances(insts=None)[source]
get_external_from_queues()[source]
get_external_instances(phase=None)[source]
get_external_to_queues()[source]
get_instances()[source]
get_internal_instances(phase=None)[source]
load()[source]
load_and_init()[source]
load_manager(manager)[source]
remove_instance(inst)[source]
set_max_queue_size(max_queue_size)[source]
set_modules(modules)[source]
set_to_restart(inst)[source]
start_external_instances(late_start=False)[source]
stop_all()[source]
try_instance_init(inst, late_start=False)[source]
try_to_restart_deads()[source]

notification Module

class shinken.notification.Notification(type='PROBLEM', status='scheduled', command='UNSET', command_call=None, ref=None, contact=None, t_to_go=0, contact_name='', host_name='', service_description='', reason_type=1, state=0, ack_author='', ack_data='', escalated=False, contacts_notified=0, start_time=0, end_time=0, notification_type=0, id=None, notif_nb=1, timeout=10, env={}, module_type='fork', reactionner_tag='None')[source]

Bases: shinken.action.Action

Please Add a Docstring to describe the class here

ack_author
ack_data
already_start_escalations
check_time
command
command_call
contact
contact_name
contacts_notified
copy_shell()[source]
creation_time
end_time
env
escalated
execution_time
exit_status
fill_data_brok_from(data, brok_type)[source]
get_id()[source]
get_initial_status_brok()[source]
get_return_from(n)[source]
host_name
is_a
is_administrative()[source]
is_launchable(t)[source]
macros = {'NOTIFICATIONAUTHORNAME': 'author_name', 'HOSTNOTIFICATIONNUMBER': 'notif_nb', 'NOTIFICATIONAUTHORALIAS': 'author_alias', 'NOTIFICATIONRECIPIENTS': 'recipients', 'HOSTNOTIFICATIONID': 'id', 'NOTIFICATIONAUTHOR': 'author', 'NOTIFICATIONISESCALATED': 'escalated', 'NOTIFICATIONTYPE': 'type', 'SERVICENOTIFICATIONNUMBER': 'notif_nb', 'NOTIFICATIONCOMMENT': 'comment', 'SERVICENOTIFICATIONID': 'id'}
module_type
my_type = 'notification'
notif_nb
notification_type
output
properties = {'reason_type': <shinken.property.StringProp object at 0x7f0048690310>, 'status': <shinken.property.StringProp object at 0x7f0048690710>, 'u_time': <shinken.property.FloatProp object at 0x7f00486905d0>, 'ack_data': <shinken.property.StringProp object at 0x7f0048690410>, 'execution_time': <shinken.property.FloatProp object at 0x7f0048690590>, 'creation_time': <shinken.property.IntegerProp object at 0x7f0048690950>, 'start_time': <shinken.property.StringProp object at 0x7f00486901d0>, 's_time': <shinken.property.FloatProp object at 0x7f0048690610>, 'worker': <shinken.property.StringProp object at 0x7f00486908d0>, 'command_call': <shinken.property.StringProp object at 0x7f0048690550>, 'notif_nb': <shinken.property.IntegerProp object at 0x7f00486906d0>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0048690910>, 'module_type': <shinken.property.StringProp object at 0x7f0048690890>, 't_to_go': <shinken.property.IntegerProp object at 0x7f0048690750>, 'service_description': <shinken.property.StringProp object at 0x7f00486902d0>, 'notification_type': <shinken.property.IntegerProp object at 0x7f0048690190>, 'contact_name': <shinken.property.StringProp object at 0x7f0048690250>, 'sched_id': <shinken.property.IntegerProp object at 0x7f00486907d0>, 'timeout': <shinken.property.IntegerProp object at 0x7f0048690810>, 'exit_status': <shinken.property.IntegerProp object at 0x7f0048690510>, 'check_time': <shinken.property.IntegerProp object at 0x7f0048690850>, 'contacts_notified': <shinken.property.StringProp object at 0x7f0048690490>, 'ack_author': <shinken.property.StringProp object at 0x7f00486903d0>, 'escalated': <shinken.property.BoolProp object at 0x7f0048690450>, 'is_a': <shinken.property.StringProp object at 0x7f0048690110>, 'state': <shinken.property.StringProp object at 0x7f0048690350>, 'contact': <shinken.property.StringProp object at 0x7f0048690650>, 'command': <shinken.property.StringProp object at 0x7f0048690790>, 'end_time': <shinken.property.StringProp object at 0x7f0048690210>, 'env': <shinken.property.StringProp object at 0x7f00486904d0>, 'output': <shinken.property.StringProp object at 0x7f0048690390>, '_in_timeout': <shinken.property.BoolProp object at 0x7f0048690690>, 'already_start_escalations': <shinken.property.StringProp object at 0x7f0048690990>, 'type': <shinken.property.StringProp object at 0x7f0048690150>, 'host_name': <shinken.property.StringProp object at 0x7f0048690290>}
reactionner_tag
reason_type
s_time
sched_id
service_description
start_time
state
status
t_to_go
timeout
type
u_time
worker

property Module

class shinken.property.UnusedProp(text=None)[source]

Bases: shinken.property.Property

A unused Property. These are typically used by Nagios but no longer useful/used by Shinken.

This is just to warn the user that the option he uses is no more used in Shinken.

class shinken.property.BoolProp(default=<object object>, class_inherit=None, unmanaged=False, help='', no_slots=False, fill_brok=None, conf_send_preparation=None, brok_transformation=None, retention=False, retention_preparation=None, to_send=False, override=False, managed=True)[source]

Bases: shinken.property.Property

A Boolean Property.

Boolean values are currently case insensitively defined as 0, false, no, off for False, and 1, true, yes, on for True).

pythonize(val)[source]
class shinken.property.IntegerProp(default=<object object>, class_inherit=None, unmanaged=False, help='', no_slots=False, fill_brok=None, conf_send_preparation=None, brok_transformation=None, retention=False, retention_preparation=None, to_send=False, override=False, managed=True)[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.FloatProp(default=<object object>, class_inherit=None, unmanaged=False, help='', no_slots=False, fill_brok=None, conf_send_preparation=None, brok_transformation=None, retention=False, retention_preparation=None, to_send=False, override=False, managed=True)[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.CharProp(default=<object object>, class_inherit=None, unmanaged=False, help='', no_slots=False, fill_brok=None, conf_send_preparation=None, brok_transformation=None, retention=False, retention_preparation=None, to_send=False, override=False, managed=True)[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.StringProp(default=<object object>, class_inherit=None, unmanaged=False, help='', no_slots=False, fill_brok=None, conf_send_preparation=None, brok_transformation=None, retention=False, retention_preparation=None, to_send=False, override=False, managed=True)[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.ListProp(default=<object object>, class_inherit=None, unmanaged=False, help='', no_slots=False, fill_brok=None, conf_send_preparation=None, brok_transformation=None, retention=False, retention_preparation=None, to_send=False, override=False, managed=True)[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]

satellite Module

scheduler Module

singleton Module

class shinken.singleton.Singleton(name, bases, dict)[source]

Bases: type

The classic Singleton class. So all instance of this class will be the same instance in fact.

sorteddict Module

class shinken.sorteddict.SortedDict(*args, **kwargs)[source]

Bases: dict

Dictionary with sorted keys.

The interface is similar to the ordinary dict’s one, but: * methods: __repr__(), __str__(), __iter__(), iterkeys(), itervalues(),

iteritems(), keys(), values(), items() and popitem() – return results taking into consideration sorted keys order;
  • new methods: largest_key(), largest_item(), smallest_key(), smallest_item() added.
clear() → None. Remove all items from D.[source]
copy() → a shallow copy of D (still as a SortedDict).[source]
classmethod fromkeys(S[, v]) → New dict with keys from S and values equal to v.[source]

v defaults to None.

items() → a list of (key, value) pairs sorted by keys[source]

(add reverse=True for reverse ordering).

iteritems() → an iterator over (key, value) pairs sorted by keys[source]

(add reverse=True for reverse ordering).

iterkeys(reverse=False)

D.__iter__() <==> iter(D) <==> D.iterkeys() -> an iterator over sorted keys (add reverse=True for reverse ordering).

itervalues() → an iterator over values sorted by keys[source]

(add reverse=True for reverse ordering).

keys() → a sorted list of keys[source]

(add reverse=True for reverse ordering).

largest_item() → a (key, value) pair with the largest key;[source]

raise KeyError if D is empty.

largest_key() → the largest key; raise KeyError if D is empty.[source]
pop(k[, d]) → v, remove specified key and return the corresponding value.[source]

If key is not found, d is returned if given, otherwise KeyError is raised

popitem() → (k, v). Remove and return a (key, value) pair with[source]

the largest key; raise KeyError if D is empty.

setdefault(k[, d]) → D.get(k,d), also set D[k]=d if k not in D[source]
smallest_item() → a (key, value) pair with the smallest key;[source]

raise KeyError if D is empty.

smallest_key() → the smallest key; raise KeyError if D is empty.[source]
update([E, ]**F) → None. Update D from dict/iterable E and F.[source]

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() → a list of values sorted by keys[source]

(add reverse=True for reverse ordering).

shinken.sorteddict.dictdoc(method)[source]

A decorator making reuse of the ordinary dict’s docstrings more concise.

trigger_functions Module

util Module

shinken.util.alive_then_spare_then_deads(x, y)[source]
shinken.util.apply_change_recursive_pattern_change(s, rule)[source]
shinken.util.expand_with_macros(ref, value)[source]
shinken.util.expand_xy_pattern(pattern)[source]
shinken.util.expect_file_dirs(root, path)[source]
shinken.util.format_t_into_dhms_format(t)[source]
shinken.util.from_bool_to_int(b)[source]
shinken.util.from_bool_to_string(b)[source]
shinken.util.from_float_to_int(val)[source]
shinken.util.from_list_to_split(val)[source]
shinken.util.get_customs_keys(d)[source]
shinken.util.get_customs_values(d)[source]
shinken.util.get_day(t)[source]
shinken.util.get_end_of_day(year, month_id, day)[source]
shinken.util.get_key_value_sequence(entry, default_value=None)[source]
shinken.util.get_obj_full_name(obj)[source]
shinken.util.get_obj_name(obj)[source]
shinken.util.get_obj_name_two_args_and_void(obj, value)[source]
shinken.util.get_sec_from_morning(t)[source]
shinken.util.get_start_of_day(year, month_id, day)[source]
shinken.util.get_wday(t)[source]
shinken.util.got_generation_rule_pattern_change(xy_couples)[source]
shinken.util.nighty_five_percent(t)[source]
shinken.util.print_date(t)[source]
shinken.util.safe_print(*args)[source]
shinken.util.scheduler_no_spare_first(x, y)[source]
shinken.util.sort_by_ids(x, y)[source]
shinken.util.strip_and_uniq(tab)[source]
shinken.util.to_best_int_float(val)[source]
shinken.util.to_bool(val)[source]
shinken.util.to_char(val)[source]
shinken.util.to_float(val)[source]
shinken.util.to_hostnames_list(ref, tab)[source]
shinken.util.to_int(val)[source]
shinken.util.to_list_of_names(ref, tab)[source]
shinken.util.to_list_string_of_names(ref, tab)[source]
shinken.util.to_name_if_possible(ref, value)[source]
shinken.util.to_split(val)[source]
shinken.util.to_svc_hst_distinct_lists(ref, tab)[source]

worker Module

class shinken.worker.Worker(id, s, returns_queue, processes_by_worker, mortal=True, timeout=300, max_plugins_output_length=8192, target=None, loaded_into='unknown')[source]

This class is used for poller and reactionner to work. The worker is a process launch by theses process and read Message in a Queue (self.s) (slave) They launch the Check and then send the result in the Queue self.m (master) they can die if they do not do anything (param timeout)

add_idletime(time)[source]
check_for_system_time_change()[source]
do_work(s, returns_queue, c)[source]
get_new_checks()[source]
id = 0
is_alive()[source]
is_killable()[source]
is_mortal()[source]
join(timeout=None)[source]
launch_new_checks()[source]
manage_finished_checks()[source]
reset_idle()[source]
send_message(msg)[source]
set_proctitle()[source]
set_zombie()[source]
start()[source]
terminate()[source]
work(s, returns_queue, c)[source]
Read the Docs v: 1.4.2
Versions
latest
stable
branch-1.4
2.4.1
2.4
2.4---4
2.4---3
2.4---2
2.4---1
2.4-----1
2.2
2.2---1
2.0.3
1.4.2
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.