shinken Package

Diagrams

Simple Acknowledge class diagram :

Inheritance diagram of shinken.acknowledge.Acknowledge

Simple Action class diagram :

Inheritance diagram of shinken.action.__Action, shinken.action.Action, shinken.eventhandler.EventHandler, shinken.notification.Notification, shinken.check.Check

Simple AutoSlots class diagram :

Inheritance diagram of shinken.autoslots.AutoSlots, shinken.singleton.Singleton

Simple BaseModule class diagram :

Inheritance diagram of shinken.basemodule.BaseModule

Simple Borg class diagram :

Inheritance diagram of shinken.borg.Borg, shinken.macroresolver.MacroResolver

Simple Brok class diagram :

Inheritance diagram of shinken.brok.Brok

Simple CherryPyBackend class diagram :

Inheritance diagram of shinken.http_daemon.CherryPyBackend

Simple Comment class diagram :

Inheritance diagram of shinken.comment.Comment

Simple ComplexExpressionFactory class diagram :

Inheritance diagram of shinken.complexexpression.ComplexExpressionFactory

Simple ComplexExpressionNode class diagram :

Inheritance diagram of shinken.complexexpression.ComplexExpressionNode

Simple ContactDowntime class diagram :

Inheritance diagram of shinken.contactdowntime.ContactDowntime

Simple Daemon class diagram :

Inheritance diagram of shinken.daemon.Daemon, shinken.daemons.arbiterdaemon.Arbiter, shinken.satellite.BaseSatellite, shinken.daemons.brokerdaemon.Broker, shinken.daemons.schedulerdaemon.Shinken, shinken.satellite.Satellite, shinken.daemons.pollerdaemon.Poller, shinken.daemons.receiverdaemon.Receiver, shinken.daemons.reactionnerdaemon.Reactionner

Simple Daterange class diagram :

Inheritance diagram of shinken.daterange.Daterange, shinken.daterange.CalendarDaterange, shinken.daterange.StandardDaterange, shinken.daterange.MonthWeekDayDaterange, shinken.daterange.MonthDateDaterange, shinken.daterange.WeekDayDaterange, shinken.daterange.MonthDayDaterange

Simple DB class diagram :

Inheritance diagram of shinken.db.DB, shinken.db_oracle.DBOracle, shinken.db_mysql.DBMysql, shinken.db_sqlite.DBSqlite

Simple declared class diagram :

Inheritance diagram of shinken.trigger_functions.declared

Simple DependencyNode class diagram :

Inheritance diagram of shinken.dependencynode.DependencyNode

Simple DependencyNodeFactory class diagram :

Inheritance diagram of shinken.dependencynode.DependencyNodeFactory

Simple Dispatcher class diagram :

Inheritance diagram of shinken.dispatcher.Dispatcher

Simple Downtime class diagram :

Inheritance diagram of shinken.downtime.Downtime

Simple DummyCommandCall class diagram :

Inheritance diagram of shinken.commandcall.DummyCommandCall, shinken.commandcall.CommandCall

Simple ExternalCommand class diagram :

Inheritance diagram of shinken.external_command.ExternalCommand

Simple ExternalCommandManager class diagram :

Inheritance diagram of shinken.external_command.ExternalCommandManager

Simple Graph class diagram :

Inheritance diagram of shinken.graph.Graph

Simple HTTPClient class diagram :

Inheritance diagram of shinken.http_client.HTTPClient

Simple HTTPDaemon class diagram :

Inheritance diagram of shinken.http_daemon.HTTPDaemon

Simple Load class diagram :

Inheritance diagram of shinken.load.Load

Simple Log class diagram :

Inheritance diagram of shinken.log.Log

Simple memoized class diagram :

Inheritance diagram of shinken.memoized.memoized

Simple Message class diagram :

Inheritance diagram of shinken.message.Message

Simple ModulesContext class diagram :

Inheritance diagram of shinken.modulesctx.ModulesContext

Simple ModulesManager class diagram :

Inheritance diagram of shinken.modulesmanager.ModulesManager

Simple ModulePhases class diagram :

Inheritance diagram of shinken.basemodule.ModulePhases

Simple Property class diagram :

Inheritance diagram of shinken.property.Property, shinken.property.UnusedProp, shinken.property.BoolProp, shinken.property.IntegerProp, shinken.property.FloatProp, shinken.property.CharProp, shinken.property.StringProp, shinken.property.PathProp, shinken.property.ConfigPathProp, shinken.property.ListProp, shinken.property.LogLevelProp, shinken.property.DictProp, shinken.property.AddrProp

Simple SatelliteLink class diagram :

Inheritance diagram of shinken.objects.item.Item, shinken.satellitelink.SatelliteLink, shinken.schedulerlink.SchedulerLink, shinken.arbiterlink.ArbiterLink, shinken.brokerlink.BrokerLink, shinken.receiverlink.ReceiverLink, shinken.pollerlink.PollerLink, shinken.reactionnerlink.ReactionnerLink

Simple Scheduler class diagram :

Inheritance diagram of shinken.scheduler.Scheduler

Simple SortedDict class diagram :

Inheritance diagram of shinken.sorteddict.SortedDict

Simple Timerange class diagram :

Inheritance diagram of shinken.daterange.Timerange

Simple Worker class diagram :

Inheritance diagram of shinken.worker.Worker

Simple WSGIREFBackend class diagram :

Inheritance diagram of shinken.http_daemon.WSGIREFBackend

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

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.

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(http_daemon=None)[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

This file is to be imported by every Shinken service component: Arbiter, Scheduler, etc. It just checks for the main requirement of Shinken.

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

copy_shell()[source]

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

get_id()[source]
get_return_from(c)[source]
is_dependent()[source]
is_launchable(t)[source]
my_type = 'check'
properties = {'check_type': <shinken.property.IntegerProp object at 0x7f0c65b44490>, 'exit_status': <shinken.property.IntegerProp object at 0x7f0c65b44150>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0c65b44510>, 's_time': <shinken.property.FloatProp object at 0x7f0c65b44410>, 'check_time': <shinken.property.IntegerProp object at 0x7f0c65b44350>, 'long_output': <shinken.property.StringProp object at 0x7f0c65b44210>, 'state': <shinken.property.IntegerProp object at 0x7f0c65b44190>, 'internal': <shinken.property.BoolProp object at 0x7f0c65b44590>, 'u_time': <shinken.property.FloatProp object at 0x7f0c65b443d0>, 'env': <shinken.property.StringProp object at 0x7f0c65b44550>, 'ref': <shinken.property.IntegerProp object at 0x7f0c65b44250>, 'from_trigger': <shinken.property.BoolProp object at 0x7f0c65b44650>, 'status': <shinken.property.StringProp object at 0x7f0c65b44110>, 'execution_time': <shinken.property.FloatProp object at 0x7f0c65b44390>, 'worker': <shinken.property.StringProp object at 0x7f0c65b44610>, 't_to_go': <shinken.property.IntegerProp object at 0x7f0c65b44290>, 'module_type': <shinken.property.StringProp object at 0x7f0c65b445d0>, 'dep_check': <shinken.property.StringProp object at 0x7f0c65b44310>, '_in_timeout': <shinken.property.BoolProp object at 0x7f0c65b440d0>, 'type': <shinken.property.StringProp object at 0x7f0c65b44090>, 'depend_on': <shinken.property.StringProp object at 0x7f0c65b442d0>, 'is_a': <shinken.property.StringProp object at 0x7f0c65906fd0>, 'poller_tag': <shinken.property.StringProp object at 0x7f0c65b444d0>, 'output': <shinken.property.StringProp object at 0x7f0c65b441d0>, 'perf_data': <shinken.property.StringProp object at 0x7f0c65b44450>}
set_type_active()[source]
set_type_passive()[source]

commandcall Module

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

Bases: shinken.commandcall.DummyCommandCall

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

args
call
command
enable_environment_macros
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 0x7f0c65911950>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0c65911990>, 'valid': <shinken.property.BoolProp object at 0x7f0c65911a10>, 'call': <shinken.property.StringProp object at 0x7f0c659118d0>, 'enable_environment_macros': <shinken.property.BoolProp object at 0x7f0c65911b10>, 'timeout': <shinken.property.IntegerProp object at 0x7f0c65911a90>, 'late_relink_done': <shinken.property.BoolProp object at 0x7f0c65911ad0>, 'command': <shinken.property.StringProp object at 0x7f0c65911910>, 'args': <shinken.property.StringProp object at 0x7f0c65911a50>, 'module_type': <shinken.property.StringProp object at 0x7f0c659119d0>}
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

class shinken.daemon.Daemon(name, config_file, is_daemon, do_replace, debug, debug_file)[source]

Bases: object

add(elt)[source]
change_to_user_group(insane=None)[source]
change_to_workdir()[source]
check_and_del_zombie_modules()[source]
check_for_system_time_change()[source]
check_parallel_run()[source]
check_shm()[source]
close_fds(skip_close_fds)[source]
compensate_system_time_change(difference)[source]
daemonize(skip_close_fds=None)[source]
do_daemon_init_and_start(use_pyro=True)[source]
do_load_modules()[source]
do_loop_turn()[source]
do_mainloop()[source]
do_stop()[source]
dump_memory()[source]
find_gid_from_name()[source]
find_modules_path()[source]
find_uid_from_name()[source]
get_header()[source]
get_retention_data()[source]
get_socks_activity(socks, timeout)[source]
handleRequests(timeout, suppl_socks=None)[source]
hook_point(hook_name)[source]
http_daemon_thread()[source]
load_config_file()[source]
load_modules_manager()[source]
look_for_early_exit()[source]
manage_signal(sig, frame)[source]
parse_config_file()[source]
print_header()[source]
properties = {'modules_dir': <shinken.property.PathProp object at 0x7f0c651a1310>, 'server_cert': <shinken.property.StringProp object at 0x7f0c65bc9590>, 'workdir': <shinken.property.PathProp object at 0x7f0c651a11d0>, 'group': <shinken.property.StringProp object at 0x7f0c651a1710>, 'ca_cert': <shinken.property.StringProp object at 0x7f0c65bc9550>, 'http_backend': <shinken.property.StringProp object at 0x7f0c65bc97d0>, 'log_level': <shinken.property.LogLevelProp object at 0x7f0c65bc9610>, 'hard_ssl_name_check': <shinken.property.BoolProp object at 0x7f0c65bc9650>, 'host': <shinken.property.StringProp object at 0x7f0c651a1550>, 'server_key': <shinken.property.StringProp object at 0x7f0c65bc9510>, 'spare': <shinken.property.BoolProp object at 0x7f0c65bc9710>, 'user': <shinken.property.StringProp object at 0x7f0c651a1650>, 'max_queue_size': <shinken.property.IntegerProp object at 0x7f0c65bc9750>, 'daemon_enabled': <shinken.property.BoolProp object at 0x7f0c65bc96d0>, 'use_ssl': <shinken.property.BoolProp object at 0x7f0c651a17d0>, 'use_local_log': <shinken.property.BoolProp object at 0x7f0c65bc95d0>, 'idontcareaboutsecurity': <shinken.property.BoolProp object at 0x7f0c65bc9690>, 'daemon_thread_pool_size': <shinken.property.IntegerProp object at 0x7f0c65bc9790>}
register_local_log()[source]
relative_paths_to_full(reference_path)[source]
request_stop()[source]
restore_retention_data(data)[source]
set_exit_handler()[source]
setup_pyro_daemon()[source]
wait_for_initial_conf(timeout=1.0)[source]
write_pid(pid=None)[source]
class shinken.daemon.Interface(app)[source]

Bases: object

api()[source]
api_full()[source]
doc = 'List the api methods and their parameters'
get_log_level()[source]
get_running_id()[source]
have_conf()[source]
ping()[source]
put_conf(conf)[source]
set_log_level(loglevel)[source]
wait_new_conf()[source]
exception shinken.daemon.InvalidPidFile[source]

Bases: exceptions.Exception

shinken.daemon.get_cur_group()[source]
shinken.daemon.get_cur_user()[source]

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

fetchall()[source]

Get all entry

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_complex_and_node_state()[source]
get_complex_node_state()[source]
get_complex_or_node_state()[source]
get_complex_xof_node_state()[source]
get_reverse_state(state)[source]
get_simple_node_state()[source]
get_state()[source]
is_valid()[source]
list_all_elements()[source]
switch_zeros_of_values()[source]
class shinken.dependencynode.DependencyNodeFactory(bound_item)[source]

Bases: object

eval_complex_cor_pattern(pattern, hosts, services, running=False)[source]
eval_cor_pattern(pattern, hosts, services, running=False)[source]
eval_simple_cor_pattern(pattern, hosts, services, running=False)[source]
eval_xof_pattern(node, pattern)[source]
expand_expression(pattern, hosts, services, running=False)[source]
find_object(pattern, hosts, services)[source]
get_host_filters(expr)[source]
get_srv_host_filters(expr)[source]
get_srv_service_filters(expr)[source]
host_flags = 'grlt'
service_flags = 'grl'

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 0x7f0c649a2d90>, 'entry_time': <shinken.property.IntegerProp object at 0x7f0c649a2b90>, 'start_time': <shinken.property.IntegerProp object at 0x7f0c649a2c10>, 'is_in_effect': <shinken.property.BoolProp object at 0x7f0c649a2dd0>, 'has_been_triggered': <shinken.property.BoolProp object at 0x7f0c649a2e10>, 'trigger_id': <shinken.property.IntegerProp object at 0x7f0c649a2c90>, 'duration': <shinken.property.IntegerProp object at 0x7f0c649a2c50>, 'author': <shinken.property.StringProp object at 0x7f0c649a2d50>, 'can_be_deleted': <shinken.property.BoolProp object at 0x7f0c649a2e50>, 'activate_me': <shinken.property.StringProp object at 0x7f0c649a2b10>, 'real_end_time': <shinken.property.IntegerProp object at 0x7f0c649a2d10>, 'end_time': <shinken.property.IntegerProp object at 0x7f0c649a2cd0>, 'fixed': <shinken.property.BoolProp object at 0x7f0c649a2bd0>}
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 0x7f0c65275890>, 'module_type': <shinken.property.StringProp object at 0x7f0c65275c10>, 'check_time': <shinken.property.IntegerProp object at 0x7f0c65275bd0>, 'exit_status': <shinken.property.StringProp object at 0x7f0c652758d0>, 'execution_time': <shinken.property.FloatProp object at 0x7f0c65275a10>, 's_time': <shinken.property.FloatProp object at 0x7f0c65275a90>, 'worker': <shinken.property.StringProp object at 0x7f0c65275c50>, 'timeout': <shinken.property.IntegerProp object at 0x7f0c65275b90>, 't_to_go': <shinken.property.StringProp object at 0x7f0c65275990>, 'is_a': <shinken.property.StringProp object at 0x7f0c652752d0>, 'long_output': <shinken.property.StringProp object at 0x7f0c65275950>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0c65275c90>, 'command': <shinken.property.StringProp object at 0x7f0c652759d0>, 'u_time': <shinken.property.FloatProp object at 0x7f0c65275a50>, 'env': <shinken.property.StringProp object at 0x7f0c65275ad0>, 'output': <shinken.property.StringProp object at 0x7f0c65275910>, '_in_timeout': <shinken.property.StringProp object at 0x7f0c65275790>, 'sched_id': <shinken.property.IntegerProp object at 0x7f0c65275b50>, 'type': <shinken.property.StringProp object at 0x7f0c652757d0>, 'perf_data': <shinken.property.StringProp object at 0x7f0c65275b10>}
reactionner_tag
s_time
sched_id
status
t_to_go
timeout
type
u_time
worker

external_command Module

class shinken.external_command.ExternalCommand(cmd_line)[source]
my_type = 'externalcommand'
class shinken.external_command.ExternalCommandManager(conf, mode)[source]
ACKNOWLEDGE_HOST_PROBLEM(host, sticky, notify, persistent, author, comment)[source]
ACKNOWLEDGE_HOST_PROBLEM_EXPIRE(host, sticky, notify, persistent, end_time, author, comment)[source]
ACKNOWLEDGE_SVC_PROBLEM(service, sticky, notify, persistent, author, comment)[source]
ACKNOWLEDGE_SVC_PROBLEM_EXPIRE(service, sticky, notify, persistent, end_time, author, comment)[source]
ADD_HOST_COMMENT(host, persistent, author, comment)[source]
ADD_SIMPLE_HOST_DEPENDENCY(son, father)[source]
ADD_SIMPLE_POLLER(realm_name, poller_name, address, port)[source]
ADD_SVC_COMMENT(service, persistent, author, comment)[source]
CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD(contact, notification_timeperiod)[source]
CHANGE_CONTACT_MODATTR(contact, value)[source]
CHANGE_CONTACT_MODHATTR(contact, value)[source]
CHANGE_CONTACT_MODSATTR(contact, value)[source]
CHANGE_CONTACT_SVC_NOTIFICATION_TIMEPERIOD(contact, notification_timeperiod)[source]
CHANGE_CUSTOM_CONTACT_VAR(contact, varname, varvalue)[source]
CHANGE_CUSTOM_HOST_VAR(host, varname, varvalue)[source]
CHANGE_CUSTOM_SVC_VAR(service, varname, varvalue)[source]
CHANGE_GLOBAL_HOST_EVENT_HANDLER(event_handler_command)[source]
CHANGE_GLOBAL_SVC_EVENT_HANDLER(event_handler_command)[source]
CHANGE_HOST_CHECK_COMMAND(host, check_command)[source]
CHANGE_HOST_CHECK_TIMEPERIOD(host, timeperiod)[source]
CHANGE_HOST_EVENT_HANDLER(host, event_handler_command)[source]
CHANGE_HOST_MODATTR(host, value)[source]
CHANGE_MAX_HOST_CHECK_ATTEMPTS(host, check_attempts)[source]
CHANGE_MAX_SVC_CHECK_ATTEMPTS(service, check_attempts)[source]
CHANGE_NORMAL_HOST_CHECK_INTERVAL(host, check_interval)[source]
CHANGE_NORMAL_SVC_CHECK_INTERVAL(service, check_interval)[source]
CHANGE_RETRY_HOST_CHECK_INTERVAL(host, check_interval)[source]
CHANGE_RETRY_SVC_CHECK_INTERVAL(service, check_interval)[source]
CHANGE_SVC_CHECK_COMMAND(service, check_command)[source]
CHANGE_SVC_CHECK_TIMEPERIOD(service, check_timeperiod)[source]
CHANGE_SVC_EVENT_HANDLER(service, event_handler_command)[source]
CHANGE_SVC_MODATTR(service, value)[source]
CHANGE_SVC_NOTIFICATION_TIMEPERIOD(service, notification_timeperiod)[source]
DELAY_HOST_NOTIFICATION(host, notification_time)[source]
DELAY_SVC_NOTIFICATION(service, notification_time)[source]
DEL_ALL_HOST_COMMENTS(host)[source]
DEL_ALL_HOST_DOWNTIMES(host)[source]
DEL_ALL_SVC_COMMENTS(service)[source]
DEL_ALL_SVC_DOWNTIMES(service)[source]
DEL_CONTACT_DOWNTIME(downtime_id)[source]
DEL_HOST_COMMENT(comment_id)[source]
DEL_HOST_DEPENDENCY(son, father)[source]
DEL_HOST_DOWNTIME(downtime_id)[source]
DEL_SVC_COMMENT(comment_id)[source]
DEL_SVC_DOWNTIME(downtime_id)[source]
DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST(host)[source]
DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS(contactgroup)[source]
DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS(contactgroup)[source]
DISABLE_CONTACT_HOST_NOTIFICATIONS(contact)[source]
DISABLE_CONTACT_SVC_NOTIFICATIONS(contact)[source]
DISABLE_EVENT_HANDLERS()[source]
DISABLE_FAILURE_PREDICTION()[source]
DISABLE_FLAP_DETECTION()[source]
DISABLE_HOSTGROUP_HOST_CHECKS(hostgroup)[source]
DISABLE_HOSTGROUP_HOST_NOTIFICATIONS(hostgroup)[source]
DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS(hostgroup)[source]
DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS(hostgroup)[source]
DISABLE_HOSTGROUP_SVC_CHECKS(hostgroup)[source]
DISABLE_HOSTGROUP_SVC_NOTIFICATIONS(hostgroup)[source]
DISABLE_HOST_AND_CHILD_NOTIFICATIONS(host)[source]
DISABLE_HOST_CHECK(host)[source]
DISABLE_HOST_EVENT_HANDLER(host)[source]
DISABLE_HOST_FLAP_DETECTION(host)[source]
DISABLE_HOST_FRESHNESS_CHECKS()[source]
DISABLE_HOST_NOTIFICATIONS(host)[source]
DISABLE_HOST_SVC_CHECKS(host)[source]
DISABLE_HOST_SVC_NOTIFICATIONS(host)[source]
DISABLE_NOTIFICATIONS()[source]
DISABLE_PASSIVE_HOST_CHECKS(host)[source]
DISABLE_PASSIVE_SVC_CHECKS(service)[source]
DISABLE_PERFORMANCE_DATA()[source]
DISABLE_SERVICEGROUP_HOST_CHECKS(servicegroup)[source]
DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS(servicegroup)[source]
DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS(servicegroup)[source]
DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS(servicegroup)[source]
DISABLE_SERVICEGROUP_SVC_CHECKS(servicegroup)[source]
DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS(servicegroup)[source]
DISABLE_SERVICE_FLAP_DETECTION(service)[source]
DISABLE_SERVICE_FRESHNESS_CHECKS()[source]
DISABLE_SVC_CHECK(service)[source]
DISABLE_SVC_EVENT_HANDLER(service)[source]
DISABLE_SVC_FLAP_DETECTION(service)[source]
DISABLE_SVC_NOTIFICATIONS(service)[source]
ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST(host)[source]
ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS(contactgroup)[source]
ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS(contactgroup)[source]
ENABLE_CONTACT_HOST_NOTIFICATIONS(contact)[source]
ENABLE_CONTACT_SVC_NOTIFICATIONS(contact)[source]
ENABLE_EVENT_HANDLERS()[source]
ENABLE_FAILURE_PREDICTION()[source]
ENABLE_FLAP_DETECTION()[source]
ENABLE_HOSTGROUP_HOST_CHECKS(hostgroup)[source]
ENABLE_HOSTGROUP_HOST_NOTIFICATIONS(hostgroup)[source]
ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS(hostgroup)[source]
ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS(hostgroup)[source]
ENABLE_HOSTGROUP_SVC_CHECKS(hostgroup)[source]
ENABLE_HOSTGROUP_SVC_NOTIFICATIONS(hostgroup)[source]
ENABLE_HOST_AND_CHILD_NOTIFICATIONS(host)[source]
ENABLE_HOST_CHECK(host)[source]
ENABLE_HOST_EVENT_HANDLER(host)[source]
ENABLE_HOST_FLAP_DETECTION(host)[source]
ENABLE_HOST_FRESHNESS_CHECKS()[source]
ENABLE_HOST_NOTIFICATIONS(host)[source]
ENABLE_HOST_SVC_CHECKS(host)[source]
ENABLE_HOST_SVC_NOTIFICATIONS(host)[source]
ENABLE_NOTIFICATIONS()[source]
ENABLE_PASSIVE_HOST_CHECKS(host)[source]
ENABLE_PASSIVE_SVC_CHECKS(service)[source]
ENABLE_PERFORMANCE_DATA()[source]
ENABLE_SERVICEGROUP_HOST_CHECKS(servicegroup)[source]
ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS(servicegroup)[source]
ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS(servicegroup)[source]
ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS(servicegroup)[source]
ENABLE_SERVICEGROUP_SVC_CHECKS(servicegroup)[source]
ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS(servicegroup)[source]
ENABLE_SERVICE_FRESHNESS_CHECKS()[source]
ENABLE_SVC_CHECK(service)[source]
ENABLE_SVC_EVENT_HANDLER(service)[source]
ENABLE_SVC_FLAP_DETECTION(service)[source]
ENABLE_SVC_NOTIFICATIONS(service)[source]
LAUNCH_HOST_EVENT_HANDLER(host)[source]
LAUNCH_SVC_EVENT_HANDLER(service)[source]
PROCESS_FILE(file_name, delete)[source]
PROCESS_HOST_CHECK_RESULT(host, status_code, plugin_output)[source]
PROCESS_HOST_OUTPUT(host, plugin_output)[source]
PROCESS_SERVICE_CHECK_RESULT(service, return_code, plugin_output)[source]
PROCESS_SERVICE_OUTPUT(service, plugin_output)[source]
READ_STATE_INFORMATION()[source]
REMOVE_HOST_ACKNOWLEDGEMENT(host)[source]
REMOVE_SVC_ACKNOWLEDGEMENT(service)[source]
RESTART_PROGRAM()[source]
SAVE_STATE_INFORMATION()[source]
SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME(host, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME(host, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_CONTACT_DOWNTIME(contact, start_time, end_time, author, comment)[source]
SCHEDULE_FORCED_HOST_CHECK(host, check_time)[source]
SCHEDULE_FORCED_HOST_SVC_CHECKS(host, check_time)[source]
SCHEDULE_FORCED_SVC_CHECK(service, check_time)[source]
SCHEDULE_HOSTGROUP_HOST_DOWNTIME(hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_HOSTGROUP_SVC_DOWNTIME(hostgroup, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_HOST_CHECK(host, check_time)[source]
SCHEDULE_HOST_DOWNTIME(host, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_HOST_SVC_CHECKS(host, check_time)[source]
SCHEDULE_HOST_SVC_DOWNTIME(host, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_SERVICEGROUP_HOST_DOWNTIME(servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_SERVICEGROUP_SVC_DOWNTIME(servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SCHEDULE_SVC_CHECK(service, check_time)[source]
SCHEDULE_SVC_DOWNTIME(service, start_time, end_time, fixed, trigger_id, duration, author, comment)[source]
SEND_CUSTOM_HOST_NOTIFICATION(host, options, author, comment)[source]
SEND_CUSTOM_SVC_NOTIFICATION(service, options, author, comment)[source]
SET_HOST_NOTIFICATION_NUMBER(host, notification_number)[source]
SET_SVC_NOTIFICATION_NUMBER(service, notification_number)[source]
SHUTDOWN_PROGRAM()[source]
START_ACCEPTING_PASSIVE_HOST_CHECKS()[source]
START_ACCEPTING_PASSIVE_SVC_CHECKS()[source]
START_EXECUTING_HOST_CHECKS()[source]
START_EXECUTING_SVC_CHECKS()[source]
START_OBSESSING_OVER_HOST(host)[source]
START_OBSESSING_OVER_HOST_CHECKS()[source]
START_OBSESSING_OVER_SVC(service)[source]
START_OBSESSING_OVER_SVC_CHECKS()[source]
STOP_ACCEPTING_PASSIVE_HOST_CHECKS()[source]
STOP_ACCEPTING_PASSIVE_SVC_CHECKS()[source]
STOP_EXECUTING_HOST_CHECKS()[source]
STOP_EXECUTING_SVC_CHECKS()[source]
STOP_OBSESSING_OVER_HOST(host)[source]
STOP_OBSESSING_OVER_HOST_CHECKS()[source]
STOP_OBSESSING_OVER_SVC(service)[source]
STOP_OBSESSING_OVER_SVC_CHECKS()[source]
commands = {'ACKNOWLEDGE_SVC_PROBLEM_EXPIRE': {'global': False, 'args': ['service', 'to_int', 'to_bool', 'to_bool', 'to_int', 'author', None]}, 'CHANGE_NORMAL_HOST_CHECK_INTERVAL': {'global': False, 'args': ['host', 'to_int']}, 'ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS': {'global': True, 'args': ['service_group']}, 'DELAY_SVC_NOTIFICATION': {'global': False, 'args': ['service', 'to_int']}, 'ENABLE_HOSTGROUP_SVC_CHECKS': {'global': True, 'args': ['host_group']}, 'CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD': {'global': True, 'args': ['contact', 'time_period']}, 'SCHEDULE_SVC_DOWNTIME': {'global': False, 'args': ['service', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'DEL_SVC_COMMENT': {'global': True, 'args': ['to_int']}, 'DISABLE_EVENT_HANDLERS': {'global': True, 'args': []}, 'REMOVE_SVC_ACKNOWLEDGEMENT': {'global': False, 'args': ['service']}, 'ENABLE_HOST_FRESHNESS_CHECKS': {'global': True, 'args': []}, 'REMOVE_HOST_ACKNOWLEDGEMENT': {'global': False, 'args': ['host']}, 'DISABLE_FLAP_DETECTION': {'global': True, 'args': []}, 'ENABLE_EVENT_HANDLERS': {'global': True, 'args': []}, 'ACKNOWLEDGE_HOST_PROBLEM_EXPIRE': {'global': False, 'args': ['host', 'to_int', 'to_bool', 'to_bool', 'to_int', 'author', None]}, 'SEND_CUSTOM_SVC_NOTIFICATION': {'global': False, 'args': ['service', 'to_int', 'author', None]}, 'ENABLE_NOTIFICATIONS': {'global': True, 'args': []}, 'SHUTDOWN_PROGRAM': {'global': True, 'args': []}, 'PROCESS_FILE': {'global': True, 'args': [None, 'to_bool']}, 'ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS': {'global': True, 'args': ['host_group']}, 'SCHEDULE_HOST_CHECK': {'global': False, 'args': ['host', 'to_int']}, 'STOP_OBSESSING_OVER_HOST_CHECKS': {'global': True, 'args': []}, 'DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS': {'global': True, 'args': ['contact_group']}, 'DISABLE_HOST_NOTIFICATIONS': {'global': False, 'args': ['host']}, 'DISABLE_FAILURE_PREDICTION': {'global': True, 'args': []}, 'DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS': {'global': True, 'args': ['contact_group']}, 'SCHEDULE_SERVICEGROUP_SVC_DOWNTIME': {'global': True, 'args': ['service_group', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'DEL_ALL_SVC_COMMENTS': {'global': False, 'args': ['service']}, 'CHANGE_SVC_CHECK_TIMEPERIOD': {'global': False, 'args': ['service', 'time_period']}, 'ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS': {'global': True, 'args': ['contact_group']}, 'SET_HOST_NOTIFICATION_NUMBER': {'global': False, 'args': ['host', 'to_int']}, 'ENABLE_FLAP_DETECTION': {'global': True, 'args': []}, 'SCHEDULE_HOSTGROUP_SVC_DOWNTIME': {'global': True, 'args': ['host_group', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS': {'global': True, 'args': ['host_group']}, 'CHANGE_MAX_SVC_CHECK_ATTEMPTS': {'global': False, 'args': ['service', 'to_int']}, 'ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS': {'global': True, 'args': ['service_group']}, 'DISABLE_PERFORMANCE_DATA': {'global': True, 'args': []}, 'DISABLE_SERVICE_FLAP_DETECTION': {'global': False, 'args': ['service']}, 'DISABLE_HOST_FRESHNESS_CHECKS': {'global': True, 'args': []}, 'CHANGE_RETRY_HOST_CHECK_INTERVAL': {'global': False, 'args': ['service', 'to_int']}, 'DEL_CONTACT_DOWNTIME': {'global': True, 'args': ['to_int']}, 'ENABLE_HOST_SVC_CHECKS': {'global': False, 'args': ['host']}, 'ENABLE_SERVICEGROUP_SVC_CHECKS': {'global': True, 'args': ['service_group']}, 'CHANGE_CONTACT_SVC_NOTIFICATION_TIMEPERIOD': {'global': True, 'args': ['contact', 'time_period']}, 'DEL_HOST_DEPENDENCY': {'global': False, 'args': ['host', 'host']}, 'CHANGE_SVC_EVENT_HANDLER': {'global': False, 'args': ['service', 'command']}, 'ADD_HOST_COMMENT': {'global': False, 'args': ['host', 'to_bool', 'author', None]}, 'DISABLE_HOST_AND_CHILD_NOTIFICATIONS': {'global': False, 'args': ['host']}, 'DISABLE_SERVICEGROUP_HOST_CHECKS': {'global': True, 'args': ['service_group']}, 'CHANGE_RETRY_SVC_CHECK_INTERVAL': {'global': False, 'args': ['service', 'to_int']}, 'ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS': {'global': True, 'args': ['service_group']}, 'DISABLE_HOST_FLAP_DETECTION': {'global': False, 'args': ['host']}, 'ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS': {'global': True, 'args': ['service_group']}, 'ACKNOWLEDGE_SVC_PROBLEM': {'global': False, 'args': ['service', 'to_int', 'to_bool', 'to_bool', 'author', None]}, 'CHANGE_CONTACT_MODSATTR': {'global': True, 'args': ['contact', None]}, 'LAUNCH_SVC_EVENT_HANDLER': {'global': False, 'args': ['service']}, 'DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS': {'global': True, 'args': ['service_group']}, 'DISABLE_HOST_SVC_NOTIFICATIONS': {'global': False, 'args': ['host']}, 'ENABLE_HOST_CHECK': {'global': False, 'args': ['host']}, 'ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST': {'global': False, 'args': ['host']}, 'STOP_ACCEPTING_PASSIVE_SVC_CHECKS': {'global': True, 'args': []}, 'DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS': {'global': True, 'args': ['host_group']}, 'ADD_SIMPLE_HOST_DEPENDENCY': {'global': False, 'args': ['host', 'host']}, 'CHANGE_SVC_NOTIFICATION_TIMEPERIOD': {'global': False, 'args': ['service', 'time_period']}, 'ENABLE_HOST_SVC_NOTIFICATIONS': {'global': False, 'args': ['host']}, 'DISABLE_HOST_EVENT_HANDLER': {'global': False, 'args': ['host']}, 'START_ACCEPTING_PASSIVE_SVC_CHECKS': {'global': True, 'args': []}, 'CHANGE_HOST_CHECK_COMMAND': {'global': False, 'args': ['host', 'command']}, 'ACKNOWLEDGE_HOST_PROBLEM': {'global': False, 'args': ['host', 'to_int', 'to_bool', 'to_bool', 'author', None]}, 'SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME': {'global': False, 'args': ['host', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'PROCESS_SERVICE_OUTPUT': {'global': False, 'args': ['service', None]}, 'DISABLE_HOST_CHECK': {'global': False, 'args': ['host']}, 'DISABLE_HOSTGROUP_HOST_NOTIFICATIONS': {'global': True, 'args': ['host_group']}, 'CHANGE_CUSTOM_HOST_VAR': {'global': False, 'args': ['host', None, None]}, 'CHANGE_MAX_HOST_CHECK_ATTEMPTS': {'global': False, 'args': ['host', 'to_int']}, 'ENABLE_CONTACT_HOST_NOTIFICATIONS': {'global': True, 'args': ['contact']}, 'SCHEDULE_CONTACT_DOWNTIME': {'global': True, 'args': ['contact', 'to_int', 'to_int', 'author', None]}, 'START_EXECUTING_SVC_CHECKS': {'global': True, 'args': []}, 'START_EXECUTING_HOST_CHECKS': {'global': True, 'args': []}, 'DISABLE_HOSTGROUP_SVC_NOTIFICATIONS': {'global': True, 'args': ['host_group']}, 'CHANGE_CUSTOM_SVC_VAR': {'global': False, 'args': ['service', None, None]}, 'DISABLE_SVC_NOTIFICATIONS': {'global': False, 'args': ['service']}, 'DISABLE_NOTIFICATIONS': {'global': True, 'args': []}, 'ENABLE_PASSIVE_HOST_CHECKS': {'global': False, 'args': ['host']}, 'DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS': {'global': True, 'args': ['service_group']}, 'STOP_OBSESSING_OVER_HOST': {'global': False, 'args': ['host']}, 'ENABLE_CONTACT_SVC_NOTIFICATIONS': {'global': True, 'args': ['contact']}, 'ENABLE_SVC_CHECK': {'global': False, 'args': ['service']}, 'DEL_HOST_DOWNTIME': {'global': True, 'args': ['to_int']}, 'ENABLE_HOST_AND_CHILD_NOTIFICATIONS': {'global': False, 'args': ['host']}, 'SCHEDULE_FORCED_HOST_SVC_CHECKS': {'global': False, 'args': ['host', 'to_int']}, 'DISABLE_SERVICE_FRESHNESS_CHECKS': {'global': True, 'args': []}, 'ENABLE_HOST_EVENT_HANDLER': {'global': False, 'args': ['host']}, 'START_OBSESSING_OVER_HOST': {'global': False, 'args': ['host']}, 'ENABLE_PERFORMANCE_DATA': {'global': True, 'args': []}, 'ENABLE_HOSTGROUP_SVC_NOTIFICATIONS': {'global': True, 'args': ['host_group']}, 'ENABLE_SERVICEGROUP_HOST_CHECKS': {'global': True, 'args': ['service_group']}, 'SET_SVC_NOTIFICATION_NUMBER': {'global': False, 'args': ['service', 'to_int']}, 'DISABLE_SVC_CHECK': {'global': False, 'args': ['service']}, 'DISABLE_SVC_EVENT_HANDLER': {'global': False, 'args': ['service']}, 'ENABLE_PASSIVE_SVC_CHECKS': {'global': False, 'args': ['service']}, 'CHANGE_CONTACT_MODHATTR': {'global': True, 'args': ['contact', None]}, 'PROCESS_HOST_OUTPUT': {'global': False, 'args': ['host', None]}, 'CHANGE_GLOBAL_SVC_EVENT_HANDLER': {'global': True, 'args': ['command']}, 'SCHEDULE_HOST_SVC_DOWNTIME': {'global': False, 'args': ['host', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'DISABLE_HOSTGROUP_HOST_CHECKS': {'global': True, 'args': ['host_group']}, 'ENABLE_HOST_FLAP_DETECTION': {'global': False, 'args': ['host']}, 'STOP_ACCEPTING_PASSIVE_HOST_CHECKS': {'global': True, 'args': []}, 'CHANGE_SVC_MODATTR': {'global': False, 'args': ['service', 'to_int']}, 'SCHEDULE_HOST_SVC_CHECKS': {'global': False, 'args': ['host', 'to_int']}, 'ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS': {'global': True, 'args': ['contact_group']}, 'ENABLE_HOSTGROUP_HOST_NOTIFICATIONS': {'global': True, 'args': ['host_group']}, 'DISABLE_SERVICEGROUP_SVC_CHECKS': {'global': True, 'args': ['service_group']}, 'SAVE_STATE_INFORMATION': {'global': True, 'args': []}, 'DEL_ALL_HOST_DOWNTIMES': {'global': False, 'args': ['host']}, 'CHANGE_GLOBAL_HOST_EVENT_HANDLER': {'global': True, 'args': ['command']}, 'DEL_ALL_SVC_DOWNTIMES': {'global': False, 'args': ['service']}, 'ADD_SIMPLE_POLLER': {'global': True, 'internal': True, 'args': [None, None, None, None]}, 'READ_STATE_INFORMATION': {'global': True, 'args': []}, 'START_OBSESSING_OVER_HOST_CHECKS': {'global': True, 'args': []}, 'DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST': {'global': False, 'args': ['host']}, 'DISABLE_HOSTGROUP_SVC_CHECKS': {'global': True, 'args': ['host_group']}, 'STOP_EXECUTING_SVC_CHECKS': {'global': True, 'args': []}, 'DEL_HOST_COMMENT': {'global': True, 'args': ['to_int']}, 'CHANGE_HOST_MODATTR': {'global': False, 'args': ['host', 'to_int']}, 'ENABLE_HOST_NOTIFICATIONS': {'global': False, 'args': ['host']}, 'CHANGE_NORMAL_SVC_CHECK_INTERVAL': {'global': False, 'args': ['service', 'to_int']}, 'START_OBSESSING_OVER_SVC_CHECKS': {'global': True, 'args': []}, 'DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS': {'global': True, 'args': ['service_group']}, 'STOP_EXECUTING_HOST_CHECKS': {'global': True, 'args': []}, 'LAUNCH_HOST_EVENT_HANDLER': {'global': False, 'args': ['host']}, 'ENABLE_HOSTGROUP_HOST_CHECKS': {'global': True, 'args': ['host_group']}, 'ENABLE_SVC_EVENT_HANDLER': {'global': False, 'args': ['service']}, 'SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME': {'global': False, 'args': ['host', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'SCHEDULE_HOSTGROUP_HOST_DOWNTIME': {'global': True, 'args': ['host_group', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'DISABLE_SVC_FLAP_DETECTION': {'global': False, 'args': ['service']}, 'SCHEDULE_FORCED_SVC_CHECK': {'global': False, 'args': ['service', 'to_int']}, 'CHANGE_CONTACT_MODATTR': {'global': True, 'args': ['contact', None]}, 'DEL_ALL_HOST_COMMENTS': {'global': False, 'args': ['host']}, 'DISABLE_PASSIVE_SVC_CHECKS': {'global': False, 'args': ['service']}, 'START_ACCEPTING_PASSIVE_HOST_CHECKS': {'global': True, 'args': []}, 'SCHEDULE_SERVICEGROUP_HOST_DOWNTIME': {'global': True, 'args': ['service_group', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'ENABLE_SERVICE_FRESHNESS_CHECKS': {'global': True, 'args': []}, 'START_OBSESSING_OVER_SVC': {'global': False, 'args': ['service']}, 'PROCESS_SERVICE_CHECK_RESULT': {'global': False, 'args': ['service', 'to_int', None]}, 'DELAY_HOST_NOTIFICATION': {'global': False, 'args': ['host', 'to_int']}, 'CHANGE_CUSTOM_CONTACT_VAR': {'global': True, 'args': ['contact', None, None]}, 'SEND_CUSTOM_HOST_NOTIFICATION': {'global': False, 'args': ['host', 'to_int', 'author', None]}, 'ENABLE_FAILURE_PREDICTION': {'global': True, 'args': []}, 'CHANGE_HOST_CHECK_TIMEPERIOD': {'global': False, 'args': ['host', 'time_period']}, 'DEL_SVC_DOWNTIME': {'global': True, 'args': ['to_int']}, 'RESTART_PROGRAM': {'global': True, 'internal': True, 'args': []}, 'ENABLE_SVC_FLAP_DETECTION': {'global': False, 'args': ['service']}, 'DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS': {'global': True, 'args': ['service_group']}, 'PROCESS_HOST_CHECK_RESULT': {'global': False, 'args': ['host', 'to_int', None]}, 'ENABLE_SVC_NOTIFICATIONS': {'global': False, 'args': ['service']}, 'STOP_OBSESSING_OVER_SVC': {'global': False, 'args': ['service']}, 'SCHEDULE_HOST_DOWNTIME': {'global': False, 'args': ['host', 'to_int', 'to_int', 'to_bool', 'to_int', 'to_int', 'author', None]}, 'SCHEDULE_SVC_CHECK': {'global': False, 'args': ['service', 'to_int']}, 'CHANGE_SVC_CHECK_COMMAND': {'global': False, 'args': ['service', 'command']}, 'DISABLE_HOST_SVC_CHECKS': {'global': False, 'args': ['host']}, 'DISABLE_CONTACT_SVC_NOTIFICATIONS': {'global': True, 'args': ['contact']}, 'ADD_SVC_COMMENT': {'global': False, 'args': ['service', 'to_bool', 'author', None]}, 'DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS': {'global': True, 'args': ['host_group']}, 'CHANGE_HOST_EVENT_HANDLER': {'global': False, 'args': ['host', 'command']}, 'DISABLE_CONTACT_HOST_NOTIFICATIONS': {'global': True, 'args': ['contact']}, 'DISABLE_PASSIVE_HOST_CHECKS': {'global': False, 'args': ['host']}, 'SCHEDULE_FORCED_HOST_CHECK': {'global': False, 'args': ['host', 'to_int']}, 'STOP_OBSESSING_OVER_SVC_CHECKS': {'global': True, 'args': []}}
dispatch_global_command(command)[source]
get()[source]
get_command_and_args(command, extcmd=None)[source]
load_arbiter(arbiter)[source]
load_receiver(receiver)[source]
load_scheduler(scheduler)[source]
open()[source]
resolve_command(excmd)[source]
search_host_and_dispatch(host_name, command, extcmd)[source]
shinken.external_command.MODATTR_NOTIFICATION_TIMEPERIOD = 65536

TODO: Add some comment about this class for the doc

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

class shinken.http_client.HTTPClient(address='', port=0, use_ssl=False, timeout=3, data_timeout=120, uri='', strong_ssl=False)[source]

Bases: object

get(path, args={}, wait='short')[source]
post(path, args, wait='short')[source]
exception shinken.http_client.HTTPException[source]

Bases: exceptions.Exception

http_daemon Module

class shinken.http_daemon.CherryPyBackend(host, port, use_ssl, ca_cert, ssl_key, ssl_cert, hard_ssl_name_check, daemon_thread_pool_size)[source]

Bases: object

get_sockets()[source]
run()[source]
stop()[source]
class shinken.http_daemon.CherryPyServer(host='127.0.0.1', port=8080, **config)[source]

Bases: shinken.webui.bottlecore.ServerAdapter

run(handler)[source]
class shinken.http_daemon.HTTPDaemon(host, port, http_backend, use_ssl, ca_cert, ssl_key, ssl_cert, hard_ssl_name_check, daemon_thread_pool_size)[source]

Bases: object

create_uri(address, port, obj_name, use_ssl=False)[source]
get_sockets()[source]
get_socks_activity(timeout)[source]
handleRequests(s)[source]
register(obj)[source]
run()[source]
set_timeout(con, timeout)[source]
shutdown()[source]
unregister(obj)[source]
exception shinken.http_daemon.InvalidWorkDir[source]

Bases: exceptions.Exception

exception shinken.http_daemon.PortNotFree[source]

Bases: exceptions.Exception

class shinken.http_daemon.WSGIREFAdapter(host='127.0.0.1', port=8080, **config)[source]

Bases: shinken.webui.bottlecore.ServerAdapter

run(handler)[source]
class shinken.http_daemon.WSGIREFBackend(host, port, use_ssl, ca_cert, ssl_key, ssl_cert, hard_ssl_name_check, daemon_thread_pool_size)[source]

Bases: object

get_sockets()[source]
get_socks_activity(socks, timeout)[source]
handle_one_request_thread(sock)[source]
run()[source]
stop()[source]

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_display_level(b)[source]
set_display_time(b)[source]
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='', end='')[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

class shinken.modulesctx.ModulesContext[source]

Bases: object

get_module(name)[source]
get_modulesdir()[source]
set_modulesdir(modulesdir)[source]

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]
shinken.modulesmanager.uniform_module_type(s)[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', enable_environment_macros=0)[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
enable_environment_macros
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 0x7f0c65906550>, 'status': <shinken.property.StringProp object at 0x7f0c65906950>, 'u_time': <shinken.property.FloatProp object at 0x7f0c65906810>, 'ack_data': <shinken.property.StringProp object at 0x7f0c65906650>, 'execution_time': <shinken.property.FloatProp object at 0x7f0c659067d0>, 'creation_time': <shinken.property.IntegerProp object at 0x7f0c65906b90>, 'start_time': <shinken.property.StringProp object at 0x7f0c65906410>, 's_time': <shinken.property.FloatProp object at 0x7f0c65906850>, 'worker': <shinken.property.StringProp object at 0x7f0c65906b10>, 'command_call': <shinken.property.StringProp object at 0x7f0c65906790>, 'notif_nb': <shinken.property.IntegerProp object at 0x7f0c65906910>, 'reactionner_tag': <shinken.property.StringProp object at 0x7f0c65906b50>, 'module_type': <shinken.property.StringProp object at 0x7f0c65906ad0>, 't_to_go': <shinken.property.IntegerProp object at 0x7f0c65906990>, 'service_description': <shinken.property.StringProp object at 0x7f0c65906510>, 'notification_type': <shinken.property.IntegerProp object at 0x7f0c659063d0>, 'contact_name': <shinken.property.StringProp object at 0x7f0c65906490>, 'sched_id': <shinken.property.IntegerProp object at 0x7f0c65906a10>, 'timeout': <shinken.property.IntegerProp object at 0x7f0c65906a50>, 'exit_status': <shinken.property.IntegerProp object at 0x7f0c65906750>, 'check_time': <shinken.property.IntegerProp object at 0x7f0c65906a90>, 'contacts_notified': <shinken.property.StringProp object at 0x7f0c659066d0>, 'ack_author': <shinken.property.StringProp object at 0x7f0c65906610>, 'enable_environment_macros': <shinken.property.BoolProp object at 0x7f0c65906bd0>, 'escalated': <shinken.property.BoolProp object at 0x7f0c65906690>, 'is_a': <shinken.property.StringProp object at 0x7f0c65906310>, 'state': <shinken.property.StringProp object at 0x7f0c65906590>, 'contact': <shinken.property.StringProp object at 0x7f0c65906890>, 'command': <shinken.property.StringProp object at 0x7f0c659069d0>, 'end_time': <shinken.property.StringProp object at 0x7f0c65906450>, 'env': <shinken.property.StringProp object at 0x7f0c65906710>, 'output': <shinken.property.StringProp object at 0x7f0c659065d0>, '_in_timeout': <shinken.property.BoolProp object at 0x7f0c659068d0>, 'already_start_escalations': <shinken.property.StringProp object at 0x7f0c65906c10>, 'type': <shinken.property.StringProp object at 0x7f0c65906390>, 'host_name': <shinken.property.StringProp object at 0x7f0c659064d0>}
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 at 0x7f0c6624ddc0>, 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, split_on_coma=True, merging='uniq')[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 at 0x7f0c6624ddc0>, 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, split_on_coma=True, merging='uniq')[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.FloatProp(default=<object object at 0x7f0c6624ddc0>, 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, split_on_coma=True, merging='uniq')[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.CharProp(default=<object object at 0x7f0c6624ddc0>, 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, split_on_coma=True, merging='uniq')[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.StringProp(default=<object object at 0x7f0c6624ddc0>, 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, split_on_coma=True, merging='uniq')[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]
class shinken.property.ListProp(default=<object object at 0x7f0c6624ddc0>, 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, split_on_coma=True, merging='uniq')[source]

Bases: shinken.property.Property

Please Add a Docstring to describe the class here

pythonize(val)[source]

satellite Module

This class is an interface for Reactionner and Poller daemons A Reactionner listens to a port for the configuration from the Arbiter The conf contains the schedulers where actionners will gather actions.

The Reactionner keeps on listening to the Arbiter (one a timeout)

If Arbiter wants it to have a new conf, the satellite forgets the previous
Schedulers (and actions into) and takes the new ones.
class shinken.satellite.BaseSatellite(name, config_file, is_daemon, do_replace, debug, debug_file)[source]

Bases: shinken.daemon.Daemon

Please Add a Docstring to describe the class here

do_stop()[source]
get_external_commands()[source]
watch_for_new_conf(timeout)[source]
what_i_managed()[source]
class shinken.satellite.IBroks(app)[source]

Bases: shinken.daemon.Interface

Interface for Brokers They connect here and get all broks (data for brokers) data must be ORDERED! (initial status BEFORE update...)

doc = 'Get broks from the daemon'
get_broks(bname)[source]
class shinken.satellite.IForArbiter(app)[source]

Bases: shinken.daemon.Interface

doc = 'Push hostname/scheduler links (receiver in direct routing)'
get_external_commands()[source]
got_conf()[source]
push_broks(broks)[source]
push_host_names(sched_id, hnames)[source]
remove_from_conf(sched_id)[source]
wait_new_conf()[source]
what_i_managed()[source]
class shinken.satellite.ISchedulers(app)[source]

Bases: shinken.daemon.Interface

Interface for Schedulers If we are passive, they connect to this and send/get actions

doc = 'Get the returns of the actions (internal)'
get_returns(sched_id)[source]
push_actions(actions, sched_id)[source]
class shinken.satellite.IStats(app)[source]

Bases: shinken.daemon.Interface

Interface for various stats about poller/reactionner activity

doc = 'Get raw stats from the daemon'
get_raw_stats()[source]
exception shinken.satellite.NotWorkerMod[source]

Bases: exceptions.Exception

class shinken.satellite.Satellite(name, config_file, is_daemon, do_replace, debug, debug_file)[source]

Bases: shinken.satellite.BaseSatellite

Our main APP class

add(elt)[source]
add_actions(lst, sched_id)[source]
adjust_worker_number_by_load()[source]
assign_to_a_queue(a)[source]
check_and_del_zombie_workers()[source]
clean_previous_run()[source]
create_and_launch_worker(module_name='fork', mortal=True)[source]
do_loop_turn()[source]
do_post_daemon_init()[source]
do_stop()[source]
get_broks()[source]
get_new_actions()[source]
get_objects_from_from_queues()[source]
get_return_for_passive(sched_id)[source]
get_returns_queue_item()[source]
get_returns_queue_len()[source]
main()[source]
manage_action_return(action)[source]
manage_returns()[source]
pynag_con_init(id)[source]
setup_new_conf()[source]

scheduler Module

class shinken.scheduler.Scheduler(scheduler_daemon)[source]

Please Add a Docstring to describe the class here

add(elt)[source]
add_Brok(brok, bname=None)[source]
add_Check(c)[source]
add_Comment(comment)[source]
add_ContactDowntime(contact_dt)[source]
add_Downtime(dt)[source]
add_EventHandler(action)[source]
add_ExternalCommand(ext_cmd)[source]
add_Notification(notif)[source]
check_for_expire_acknowledge()[source]
check_freshness()[source]
check_orphaned()[source]
clean_caches()[source]
clean_queues()[source]
consume_results()[source]
del_comment(c_id)[source]
del_contact_downtime(dt_id)[source]
del_downtime(dt_id)[source]
delete_zombie_actions()[source]
delete_zombie_checks()[source]
die()[source]
dump_objects()[source]
fill_initial_broks(bname, with_logs=False)[source]
get_actions_from_passives_satellites()[source]
get_and_register_check_result_brok(item)[source]
get_and_register_program_status_brok()[source]
get_and_register_status_brok(item)[source]
get_and_register_update_program_status_brok()[source]
get_broks(bname)[source]
get_new_actions()[source]
get_new_broks()[source]
get_objects_from_from_queues()[source]
get_program_status_brok()[source]
get_retention_data()[source]
get_to_run_checks(do_checks=False, do_actions=False, poller_tags=['None'], reactionner_tags=['None'], worker_name='none', module_types=['fork'])[source]
hook_point(hook_name)[source]
is_connection_try_too_close(elt)[source]
load_conf(conf, in_test=False)[source]
load_external_command(e)[source]
load_satellites(pollers, reactionners)[source]
manage_internal_checks()[source]
push_actions_to_passives_satellites()[source]
put_results(c)[source]
pynag_con_init(id, type='poller')[source]
reset()[source]
reset_topology_change_flag()[source]
restore_retention_data(data)[source]
retention_load()[source]
run()[source]
run_external_command(command)[source]
run_external_commands(cmds)[source]
scatter_master_notifications()[source]
schedule()[source]
send_broks_to_modules()[source]
update_business_values()[source]
update_downtimes_and_comments()[source]
update_recurrent_works_tick(f_name, new_tick)[source]
update_retention_file(forced=False)[source]

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

class shinken.trigger_functions.declared(f)[source]

Bases: object

Decorator to add function in trigger environnement

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.filter_any(name)[source]
shinken.util.filter_host_by_bp_rule_label(label)[source]
shinken.util.filter_host_by_group(group)[source]
shinken.util.filter_host_by_name(name)[source]
shinken.util.filter_host_by_regex(regex)[source]
shinken.util.filter_host_by_template(tpl)[source]
shinken.util.filter_none(name)[source]
shinken.util.filter_service_by_bp_rule_label(label)[source]
shinken.util.filter_service_by_host_bp_rule_label(label)[source]
shinken.util.filter_service_by_host_name(host_name)[source]
shinken.util.filter_service_by_host_template_name(tpl)[source]
shinken.util.filter_service_by_hostgroup_name(group)[source]
shinken.util.filter_service_by_name(name)[source]
shinken.util.filter_service_by_regex_host_name(regex)[source]
shinken.util.filter_service_by_regex_name(regex)[source]
shinken.util.filter_service_by_servicegroup_name(group)[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.jsonify_r(obj)[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.split_semicolon(line, maxsplit=None)[source]

Split a line on semicolons characters but not on the escaped semicolons

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, split_on_coma=True)[source]
shinken.util.to_svc_hst_distinct_lists(ref, tab)[source]
shinken.util.unique_value(val)[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', http_daemon=None)[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: 2.0.3
Versions
stable
latest
branch-1.4
2.0.3
1.4.2
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.