# This config file defines Shinken specific objects like # satellites or Realms # # This file can be used for defining a simple environement: # * one scheduler that schedules the checks (but doesn't launch them) # * one poller (that launches the checks) # * one reactionner (that sends the notifiations) # * one broker (that gives jobs to modules. Modules export data like logs, # status.dat, mysql export, etc etc) # * some of the brokers modules (that do the jobs) # * one arbiter (that reads the configuration and dispatches it to all # others) # # So there is no high availability here, just a simple "Nagios # equivalent" (but with more perf and less code! ) # The scheduler is a "Host manager". It gets the hosts and theirs # services and it schedules the checks for the pollers. define scheduler{ scheduler_name scheduler-1 ; just the name address localhost ; ip or dns address of the daemon port 7768 ; tcp port of the daemon #optional spare 0 ; (0 = not a spare, 1 = is spare) weight 1 ; (some schedulers can manage more hosts than others) timeout 3 ; 'ping' timeout data_timeout 120 ; 'data send' timeout max_check_attempts 3 ; if at least max_check_attempts ping failed, the node is DEAD check_interval 60 ; ping it every minute modules PickleRetention # Interesting modules: # PickleRetention : Save data before exiting in flat file # MemcacheRetention : Same but in a memcache server # RedisRetention : same, but in a Redis server :) # NagiosRetention : only READ retention info from a nagios retention file #advanced feature realm All ; optional (realm are multisites features) } # Pollers launch checks define poller{ poller_name poller-1 address localhost port 7771 # optional manage_sub_realms 0 ; optional and advanced: does it take jobs from schedulers of sub realms? min_workers 4 ; optional: starts with N processes workers. 0 means: "number of cpus" max_workers 4 ; optional: no more than N processes workers. 0 means: "number of cpus" processes_by_worker 256 ; optional: each workers manage 256 checks polling_interval 1 ; optional: take jobs from schedulers each 1 second timeout 3 ; 'ping' timeout data_timeout 120 ; 'data send' timeout check_interval 60 ; ping it every minute max_check_attempts 3 ; if at least max_check_attempts ping failed, the node is DEAD # advanced features #modules NrpeBooster #poller_tags None realm All } # Poller can have a nrpe module: commands tagged with # nrpe_poller as module_type will be managed by this module. # it will bypass the launch of check_nrpe, and will do the # connection itself. define module{ module_name NrpeBooster module_type nrpe_poller } # Reactionner launch notifications define reactionner{ reactionner_name reactionner-1 address localhost port 7769 spare 0 # optional manage_sub_realms 0 ;optional: like for poller min_workers 1 ;optional: like for poller max_workers 15 ;optional: like for poller polling_interval 1 ;optional: like for poller timeout 3 ; 'ping' timeout data_timeout 120 ; 'data send' timeout check_interval 60 ; ping it every minute max_check_attempts 3 ; if at least max_check_attempts ping failed, the node is DEAD # advanced realm All } # The broker manages data export (in flat file or in database) # with it's modules # Here just log files and status.dat file modules define broker{ broker_name broker-1 address localhost port 7772 spare 0 # Which modules to load? LiveSatus and logs by default. modules Livestatus, Simple-log, WebUI, PickleRetentionBroker # Other interesting modules to add: # PickleRetentionBroker : save data when quitting # ToNdodb_Mysql : NDO database support # NPCD : Use the PNP addon # WebUI : Shinken Web interface # optional manage_sub_realms 1 ; optional, like for poller manage_arbiters 1 ; optional: take data from Arbiter. There should be ;only one broker for the arbiter check_interval 60 ; ping it every minute timeout 3 ; 'ping' timeout data_timeout 120 ; 'data send' timeout max_check_attempts 3 ; if at least max_check_attempts ping failed, the node is DEAD # advanced realm All } # Now the modules for the broker. The first 2 that are used, and all # the others :) # The log managment for ALL daemons (all in one log, cool isn't it? ). define module{ module_name Simple-log module_type simple_log path /var/log/shinken/nagios.log archive_path /var/log/shinken/archives/ } # Status.dat and objects.cache export. For the old Nagios interface define module{ module_name Status-Dat module_type status_dat status_file /var/log/shinken/status.dat object_cache_file /var/log/shinken/objects.cache status_update_interval 15 ; update status.dat every 15s } # The log managment for ALL daemons (all in one log, cool isn't it? ). define module{ module_name WebUI module_type webui host 0.0.0.0 ; mean all interfaces port 7767 # CHANGE THIS VALUE!!!!!!! auth_secret CHANGE_ME # Advanced options. # Do not touch if you don't know what you are doing #http_backend wsgiref # ; can be also: cherrypy, paste, tornado, twisted # ; or gevent # Modules for the WebUI. modules Apache_passwd,ActiveDir_UI,Cfg_password,Mongodb } # The log managment for ALL daemons (all in one log, cool isn't it? ). define module{ module_name ActiveDir_UI module_type ad_webui # UNCOMMENT this line to really enable this module and allow it # to connect! #ldap_uri ldaps://myserver username user password password basedn DC=domain,DC=com } # The log managment for ALL daemons (all in one log, cool isn't it? ). define module{ module_name Apache_passwd module_type passwd_webui # WARNING: put the full PATH for this value! passwd /etc/shinken/htpasswd.users } # The log managment for ALL daemons (all in one log, cool isn't it? ). define module{ module_name Cfg_password module_type cfg_password_webui } # All other modules that can be called if you have installed the # databases, or if you want to test something else :) # Here the NDO/MySQL module # So you can use with NagVis or Centreon define module{ module_name ToNdodb_Mysql module_type ndodb_mysql database ndo ; database name user root ; user of the database password root ; must be changed host localhost ; host to connect to character_set utf8 ;optional, UTF8 is the default # If you want to mix Shinken AND Nagios/icinga in the same db # you need to offset shinken instance id so they will not # override/delete other ones. Here for 5 nagios box. # nagios_mix_offset 5 } # Export services perfdata to flat file. For centreon or perfparse define module{ module_name Service-Perfdata module_type service_perfdata path /var/log/shinken/service-perfdata # mode a ; optional. a = append, w = overwrite, p =pipe # template $LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\t$SERVICESTATE$\n } # For hosts this time # like the previous one, but for hosts. define module{ module_name Host-Perfdata module_type host_perfdata path /var/log/shinken/host-perfdata # mode a ; optional. a = append, w = overwrite, p =pipe # template $LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTOUTPUT$\t$HOSTSTATE$\t$HOSTPERFDATA$\n } # You know livestatus? Yes, there a Livestatus module for shinken too :) define module{ module_name Livestatus module_type livestatus host * ; * = listen on all configured ip addresses port 50000 ; port to listen database_file /var/log/shinken/livestatus.db # Only set debug if you have problems with this module #debug /tmp/ls.debug # Set to 1 if you want to dump queries/responses too # WARNING: it is very verbose #debug_queries 0 } # Send all logs to syslog define module{ module_name Syslog module_type syslog } # Use with the PNP interface define module{ module_name NPCD module_type npcdmod config_file /usr/local/pnp4nagios/etc/npcd.cfg } ############################# For the schedulers # Now the good flat file for retention module define module{ module_name PickleRetention module_type pickle_retention_file_generic path /var/log/shinken/retention.dat } # Now the good flat file for retention module define module{ module_name PickleRetentionBroker module_type pickle_retention_file_generic path /var/log/shinken/retention_broker.dat } # Now the good flat file for retention module define module{ module_name PickleRetentionArbiter module_type pickle_retention_file_generic path /var/log/shinken/retention_arbiter.dat } ############################# For the schedulers # Now the good flat file for retention module define module{ module_name NagiosRetention module_type nagios_retention_file path /var/log/shinken/retention-nagios.dat } # Now the memcache one # Now the good flat file for retention module define module{ module_name MemcacheRetention module_type memcache_retention server 127.0.0.1 port 11211 } # And the redis one # Now the good flat file for retention module define module{ module_name RedisRetention module_type redis_retention server 127.0.0.1 } # The old namaed pipe way from Nagios define module{ module_name CommandFile module_type named_pipe command_file /var/log/shinken/rw/nagios.cmd } # You know GLPI? You can load your hosts from this app (with the # webservices plugins for GLPI, in xmlrpc mode) # All hosts read from this will be added to the others of the # standard flat file # Warning: just load host_name, experimental. define module{ module_name GLPIImport module_type glpi_import uri http://localhost/glpi/plugins/webservices/xmlrpc.php login_name glpi login_password glpi # use_property otherserial ;optional. Will take use value from the otherserial # field in GLPI (Inventory number: in the web interface) } # You know GLPI? You can load all configuration from this app ( # with the webservices plugins for GLPI, in xmlrpc mode # and with plugin monitoring for GLPI) # All configuration read from this will be added to the others of the # standard flat file define module{ module_name GLPI module_type glpi uri http://localhost/glpi/plugins/webservices/xmlrpc.php login_name glpi login_password glpi } # You know NSCA? You can send check results to shinken # using send_nsca command define module{ module_name NSCA module_type nsca_server host * port 5667 encryption_method 0 password helloworld } # This module implement TSCA, a thrift interface to submit checks result define module{ module_name TSCA module_type tsca_server host * port 9090 } # You know VMWare? It's cool to VMotion VM, but after it's hard to # follow host dependencies when it move. With this module, you can # just lookup at the vcenter from times to times and update dependencies define module{ module_name VMWare_auto_linking module_type hot_dependencies mapping_file /tmp/vmware_mapping_file.json mapping_command /usr/lib/shinken/plugins/link_vmware_host_vm.py -x '/usr/lib/shinken/plugins/check_esx3.pl' -V 'vcenter.mydomain.com' -u 'admin' -p 'secret' -r 'lower|nofqdn' -o /tmp/vmware_mapping_file.json mapping_command_interval 60 ; optional mapping_command_timeout 300 ; optional # Only useful if you want debug output. Can # be verbose for large installations # debug 1 } # Arbiter module to change on the fly a poller tag of a # command by another. # Useful when you use a fixed configuration tool that do not allow you # to configure poller_tag. define module{ module_name HackCommandsPollerTag module_type hack_commands_poller_tag cmd_line_match (.*)check_esx3(.*) poller_tag esx3 } # Arbiter module to change on the fly a poller tag of hosts # and services by searchg a custom macro # Useful when you use a fixed configuration tool that do not allow you # to configure poller_tag. define module{ module_name HackCommandsPollerTag module_type hack_commands_poller_tag host_macro_name _poller_tag service_macro_name _poller_tag } # Hosts and Services configuration can be pulled from a MySQL database # All hosts and services read from the database will be added to the # others of the standard flat file. # You can easily use an existing database, you just have to define the queries. # It can be a useful module to use for HA too :) # Warning: only for hosts and services define module{ module_name MySQLImport module_type mysql_import host localhost login root password azerty database supervision reqhosts SELECT host_name, alias, realm, address ,template AS 'use' FROM hosts reqservices SELECT host_name, service_description, normal_check_interval, check_command ,template AS 'use' FROM services reqcontacts SELECT contact_name, email, template AS 'use' FROM contacts } # The arbiter definition is optional # WARNING: You must change host_name with the hostname of your machine !!! define arbiter{ arbiter_name Arbiter-Master # host_name node1 ;result of the hostname command under Unix address localhost ;IP or DNS adress port 7770 spare 0 # uncomment the line below if you want to use the GLPI module and the NSCA one # modules CommandFile,GLPIImport, NSCA, VMWare_auto_linking, TSCA # Uncomment theses lines in a HA architecture so the master # and slaves know how much time to wait the other # check_interval 60 ; ping it every minute # timeout 3 ; 'ping' timeout # data_timeout 120 ; 'data send' timeout # max_check_attempts 3 ; if at least max_check_attempts ping failed, the node is DEAD # List of interesting modules: # CommandFile : open the named pipe nagios.cmd # PickleRetentionArbiter : save data before exiting # NSCA : NSCA server # VMWare_auto_linking : lookup at Vphere server for dependencies # GLPIImport : import hosts from GLPI # TSCA : TSCA server } # The receiver manages passive information. It's just a "buffer" that # will be readfrom the arbiter to dispatch data define receiver{ receiver_name receiver-1 address localhost port 7773 spare 0 # The main goal of the receiver is to load # Passive modules, like the NSCA one #modules NSCA,CommandFile timeout 3 ; 'ping' timeout data_timeout 120 ; 'data send' timeout max_check_attempts 3 ; if at least max_check_attempts ping failed, the node is DEAD check_interval 60 ; ping it every minute # advanced realm All } ## Module: Mongodb ## Loaded by: Arbiter, WebUI # In Arbiter: Read objects in a mongodb database (like hosts or services). # In WebUI: Save/read user preferences. define module { module_name Mongodb module_type mongodb uri mongodb://localhost/?safe=true database shinken } # Very advanced feature for multisite managment. # Consider to look at the doc before touching it :) define realm{ realm_name All default 1 }