==== Adagios ==== This an intent to document pip installation of Adagios on Debian. ==== Installation ==== # apt-get install python-pip libapache2-mod-wsgi pynag # pip install simplejson django==1.5 pynag adagios Copy file /etc/apache2/sites-available/adagios.conf: # Create the wsgi process group WSGISocketPrefix run/wsgi WSGIDaemonProcess adagios user=nagios group=nagios processes=1 threads=25 WSGIScriptAlias /adagios /usr/local/lib/python2.7/dist-packages/adagios/wsgi.py # Run adagios under /adagios Alias /adagios/media /usr/local/lib/python2.7/dist-packages/adagios/media # Everything under /adagios runs in the above process group # WSGIProcessGroup adagios AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user # Redirect /adagios to /adagios/ # So path to css/javascript works RedirectMatch ^/adagios$ /adagios/ Run: # mkdir -p /etc/nagios3/adagios # mkdir -p /var/lib/adagios/userdata # pynag config --append cfg_dir=/etc/nagios3/adagios Configure /etc/adagios/adagios.conf # nagios_config - Path to your nagios configuration file # If set, adagios will use this file to manage your object # definitions. If set to None, adagios will search most common # paths like /etc/nagios/nagios.cfg for it #nagios_config = "/etc/nagios/nagios.cfg" nagios_config = "/usr/local/nagios/etc/nagios.cfg" # This should be the URL to your nagios server. If set, then # Adagios can link you directly from configuration to live object. # If you don't need this feature. Set nagios_url to '' or None #nagios_url = "http://mynagiosserver/nagios" nagios_url = "/nagios" # destination_directory - Where adagios will store new objects # by default. You should make sure that this directory exists # and nagios.cfg has a cfg_dir=/etc/nagios/adagios/ destination_directory = "/etc/nagios3/adagios/" # livestatus_path - Path to livestatus socket livestatus_path = None # enable_githandler - If set to true, and your /etc/nagios/ directory # is a git repository. adagios will automatically commit changes when # they are made. enable_githandler = True # enable_loghandler - If set to true, all changes adagios makes to # object definitions will be logged to a file. enable_loghandler = False # auto_reload - If set to True, then nagios is reloaded automatically on # changes. Not really recommended unless you are sure you want to fire # a nagios reload after every single change. auto_reload = False # nagios_init_script - Path to init script used to start/stop nagios # Adagios uses this to reload nagios after configuration changes nagios_init_script="sudo /etc/init.d/nagios" # nagios_binary - Path to your nagios binary # Adagios uses this to run "nagios -v /etc/nagios/nagios.cfg" nagios_binary="/usr/sbin/nagios" # escape_html_tags - Escape html tags in status view # If this is enabled, html code in plugin outputs is escaped. # If you set this to False, then plugins will be able to inject # HTML code into adagios web interface escape_html_tags = True # warn_if_selinux_is_active - Check (and warn user) if selinux is running # You should only turn this off if you have configured your selinux policy # and know what you are doing warn_if_selinux_is_active=True # pnp_filepath - Path to pnp4nagios index.php # This is used for integrated graphs into the status view # if you do not use pnp or do not need the status view of adagios # simply change this to any other file that exists #pnp_filepath="/usr/share/nagios/html/pnp4nagios/index.php" pnp_filepath="/usr/local/pnp4nagios/share/index.php" # contrib_dir - Path to user contributed views contrib_dir = "/var/lib/adagios/contrib/" # serverside_includes - Path to user contributed includes # The files located in this directory can be used to include # user contributed html into the header and footer of every page respectively serverside_includes = "/etc/adagios/ssi" # title_prefix - Title of every page is prefixed with this. # You can customize this if you have multiple adagios instances # and you want to distinguish the tabs in browser. title_prefix = "Adagios -" # enable_pnp4nagios - Enable pnp4nagios support (True by default). # Disabling this removes the pnp mouse-over graphs as well as the graphs # tab from the status views. enable_pnp4nagios = True # enable_graphite - Enable graphite integration with graphite # If set to True, status_detail view of hosts and services # Will show related graphs. enable_graphite = False # graphite_url - URL to your graphite instance # If specified, and enable_graphite is set to True, # connect to this graphite instance graphite_url = "http://localhost:9091" # graphite_querystring - Customize the querystring that is sent to # graphite's /render? method. {host} {service} and {metric} will all # be replaced with actual values while {host_} {service_} and {metric_} # will apply common escaping techniques, i.e.: example.com becomes example_com graphite_querystring = "target={host_}.{service_}.{metric_}&width=500&height=200&from={from_}d&lineMode=connected&title={title}&target={host_}.{service_}.{metric_}_warn&target={host_}.{service_}.{metric_}_crit" # graphite_title - Put this string at the top of graphite graphs graphite_title = "{host} - {service} - {metric}" # Include configuration options from these config files include="/etc/adagios/conf.d/*.conf" ===== virtualenv installation ===== cd /opt virtualenv adagios source /opt/adagios/bin/activate pip install django==1.4.15 pynag adagios Create /etc/apache2/conf-available/adagios.conf WSGISocketPrefix /var/run/apache2/wsgi WSGIDaemonProcess adagios user=nagios group=nagios processes=1 threads=25 python-path=/opt/adagios:/opt/adagios/lib/python2.7/site-packages/adagios WSGIProcessGroup adagios WSGIScriptAlias /adagios /opt/adagios/lib/python2.7/site-packages/adagios/apache/adagios.wsgi WSGIPythonPath /opt/adagios Alias /adagios/media /opt/adagios/lib/python2.7/site-packages/adagios/media AuthName "Adagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user Edit /etc/adagios/adagios.conf: # nagios_config - Path to your nagios configuration file # If set, adagios will use this file to manage your object # definitions. If set to None, adagios will search most common # paths like /etc/nagios/nagios.cfg for it #nagios_config = "/etc/nagios/nagios.cfg" nagios_config = "/usr/local/nagios/etc/nagios.cfg" # This should be the URL to your nagios server. If set, then # Adagios can link you directly from configuration to live object. # If you don't need this feature. Set nagios_url to '' or None #nagios_url = "http://mynagiosserver/nagios" nagios_url = "/nagios" # destination_directory - Where adagios will store new objects # by default. You should make sure that this directory exists # and nagios.cfg has a cfg_dir=/etc/nagios/adagios/ #destination_directory = "/etc/nagios/adagios/" destination_directory = "/usr/local/nagios/etc/adagios" # livestatus_path - Path to livestatus socket #livestatus_path = None livestatus_path = "/usr/local/nagios/var/rw/live" # enable_githandler - If set to true, and your /etc/nagios/ directory # is a git repository. adagios will automatically commit changes when # they are made. enable_githandler = True # enable_loghandler - If set to true, all changes adagios makes to # object definitions will be logged to a file. enable_loghandler = False # auto_reload - If set to True, then nagios is reloaded automatically on # changes. Not really recommended unless you are sure you want to fire # a nagios reload after every single change. auto_reload = False # nagios_init_script - Path to init script used to start/stop nagios # Adagios uses this to reload nagios after configuration changes nagios_init_script="sudo /etc/init.d/nagios" # nagios_binary - Path to your nagios binary # Adagios uses this to run "nagios -v /etc/nagios/nagios.cfg" #nagios_binary="/usr/sbin/nagios" nagios_binary="/usr/local/nagios/bin/nagios" # escape_html_tags - Escape html tags in status view # If this is enabled, html code in plugin outputs is escaped. # If you set this to False, then plugins will be able to inject # HTML code into adagios web interface escape_html_tags = True # warn_if_selinux_is_active - Check (and warn user) if selinux is running # You should only turn this off if you have configured your selinux policy # and know what you are doing warn_if_selinux_is_active=True # pnp_filepath - Path to pnp4nagios index.php # This is used for integrated graphs into the status view # if you do not use pnp or do not need the status view of adagios # simply change this to any other file that exists #pnp_filepath="/usr/share/nagios/html/pnp4nagios/index.php" pnp_filepath="/usr/local/pnp4nagios/share/index.php" # contrib_dir - Path to user contributed views contrib_dir = "/var/lib/adagios/contrib/" # serverside_includes - Path to user contributed includes # The files located in this directory can be used to include # user contributed html into the header and footer of every page respectively serverside_includes = "/etc/adagios/ssi" # title_prefix - Title of every page is prefixed with this. # You can customize this if you have multiple adagios instances # and you want to distinguish the tabs in browser. title_prefix = "Adagios -" # enable_pnp4nagios - Enable pnp4nagios support (True by default). # Disabling this removes the pnp mouse-over graphs as well as the graphs # tab from the status views. enable_pnp4nagios = True # enable_graphite - Enable graphite integration with graphite # If set to True, status_detail view of hosts and services # Will show related graphs. enable_graphite = False # graphite_url - URL to your graphite instance # If specified, and enable_graphite is set to True, # connect to this graphite instance graphite_url = "http://localhost:9091" # graphite_querystring - Customize the querystring that is sent to # graphite's /render? method. {host} {service} and {metric} will all # be replaced with actual values while {host_} {service_} and {metric_} # will apply common escaping techniques, i.e.: example.com becomes example_com graphite_querystring = "target={host_}.{service_}.{metric_}&width=500&height=200&from={from_}d&lineMode=connected&title={title}&target={host_}.{service_}.{metric_}_warn&target={host_}.{service_}.{metric_}_crit" # graphite_title - Put this string at the top of graphite graphs graphite_title = "{host} - {service} - {metric}" # Include configuration options from these config files include="/etc/adagios/conf.d/*.conf" mkdir /usr/local/nagios/etc/adagios useradd adagios chown nagios.adagios /usr/local/nagios/etc/adagios chmod 774 /usr/local/nagios/etc/adagios a2enconf adagios systemctl restart apache2 ==== Nagios configuration ==== Edit /usr/local/nagios/etc/nagios.cfg: # Definitions for Adagios management cfg_dir=/usr/local/nagios/etc/adagios ==== Configuration steps ==== * Add hosttemplate * Add timeperiods * Add commands * Add contacttemplate * Add contactgroup * Add contact * Add hosttemplate * Add hostgroups * Add host * Add servicetemplate * Add service ===== References ===== * https://github.com/opinkerfi/adagios/wiki/Installing-Adagios-from-source-on-Debian * https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/