Giter VIP home page Giter VIP logo

okconfig's Introduction

Build status

About

okconfig a robust template mechanism for Nagios configuration files. Providing standardized set of configuration templates and select quality plugins to enterprise quality monitoring.

Getting Started

Standard http checks on example.com:

okconfig addhost --host example.com --template http

Also check ssl connection and ssl certificate:

okconfig addtemplate --host example.com --template https

Create a new host and give them standard linux checks. Then install nrpe on it:

okconfig addhost --host linuxhost.example.com --address 127.1.1.1 --template linux
okconfig install --host linuxhost.example.com --ssh --user root --password my_password

Add mssql service checks to an existing host:

okconfig addtemplate --host sqlserver.example.com --template mssql

Supported Platforms for nagios server

The developers work hard to make sure templates, packages and plugins and service checks work and don't break when okconfig is upgraded.

With over 60 plugins and 380 service templates there are limits to how many platforms we can support. Currently we support running the nagios server on:

  • RHEL 7.x / 8.x
  • Centos 7.x / 8.x

If anyone is willing to provide decent quality packages for debian or other distros we are happy to build and host them.

Installing on rhel/centos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/$HOSTTYPE/epel-release-6-8.noarch.rpm
rpm -Uhv http://opensource.is/repo/ok-release-10-1.el6.noarch.rpm
yum-config-manager --enable ok-testing

yum install okconfig
okconfig verify

Requirements

At the very least okconfig needs the following:

  • python-3.6
  • pynag
  • python-paramiko (for deploying remote agents via ssh)
  • winexe (for deploying remote agents to windows servers)

Installing from source

If you want to play with the source or try it out on an unsupported platform. These instructions should get you started:

cd /opt
git clone https://github.com/opinkerfi/okconfig.git
echo 'export PYTHONPATH=$PYTHONPATH:/opt/okconfig' > /etc/profile.d/okconfig.sh
cp /opt/okconfig/etc/okconfig.conf /etc/okconfig.conf
source /etc/profile

ln -s /opt/okconfig/usr/share/okconfig /usr/share/
ln -s /opt/okconfig/usr/bin/okconfig /usr/local/bin/

# Remember to edit /etc/okconfig.conf and verify all paths apply to your system
# Configure Nagios.cfg
okconfig init

# Test
okconfig verify

Contact us

okconfig's People

Contributors

dmurnane avatar gardart avatar gradecke avatar gudmmk avatar hakong avatar mikecom32 avatar pall-valmundsson avatar palli avatar richard-allen avatar samueljon avatar tomas-edwardsson avatar worsco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

okconfig's Issues

okconfig install agent multiple issues

There are multiple issues with the new output from okconfig install.

  1. Command crashes if running as user because user lacks write permissions to /var/log/okconfig/install_agent.log

  2. When error occurs, no troubleshooting output is printed to the user, instead only the "please check install_agent.log for errors is outputted. This can get very annoying.

  3. In some cases errors can occur and the only output in the error log is "please check install_agent.log for more information"

  4. When installing from adagios and there are any errors, the only output is "permission denied" on install_agent.log

Error: Template 'linux-server' specified in host definition could not be found (config file '/etc/nagios/okconfig/hosts/mygroup/myhost-host.cfg', starting on line 3)

Steps to reproduce:

  1. Install and configure OKConfig + adagios.
  2. Using the adagios Web UI, create a 'mygroup' host group the OKConfig way.
  3. Using the adagios Web UI, create a 'myhost' host the OKConfig way. Make it a member of the above group
  4. Perform any action that involves Nagios verifying the configuration.

It produces the above error message. The host definition OKConfig created inherits from a 'linux-server' template o abstract host definition that isn't shipped either with OKConfig, pynag or adagios, nor with the Nagios default configuration.


define host {
    use                         linux-server
...

reading the OKConfig source code, this section shows other templates names 'windows-server' and 'generic-switch' are used that don't exist either.

Adding multiple templates at the same time

I would like to be able to do something like this:
okconfig addtemplate <host> --template <t1>,<t2>,<t3>,<t4>
and have the four templates applied to the host.

This would save me the time writing for loops.

I'll write the patch; I just need to know where I should put the splitting logic (CLI script or in the library, CLI makes sense, right?). And also the preferred delimiter, it seems logical to use , but that would break support for templates with , in their name. I don't do that, have you seen it used somewhere? A possible workaround could be to check if the whole template string existed as a template and if not try to split it up and then finally fail if nothing succeeds.

okconfig upgrade and notification commands

okconfig upgrade does not upgrade uses of sms notification commands.

Fix suggestion

pynag update service_notification_commands=okc-notify-service-by-sms where service_notification_commands=notify-service-by-sms
pynag update host_notification_commands=okc-notify-host-by-sms where host_notification_commands=notify-host-by-sms

okconfig update breaks install agent

okconfig install gives me a error referring /tmp/install_nrpe.sh which is default in py code.

/etc/okconfig.conf does not contain install_nrpe_script configuration variable on a older machine.

/etc/okconfig.conf.rpmnew was created during install because of local changes.

vmware template needs an overhaul

The opsview vmware plugins defined in the vmware template are not packaged but are defined in both services and commands configuration files.

A decision needs to be made on which plugins stay and which don't, what needs to be packaged and also some documentation on how to configure vmware monitoring.

nagios-okplugin-check_rhcs malformed config

nagios-okplugin-check_rhcs-0.0.4-1.el6.x86_64 config in /etc/nrpe.d/check_rhcs.cfg containt reference to
/usr/lib6464 instead of /usr/lib64

# cat /etc/nrpe.d/check_rhcs.cfg 
command[check_rhcs]=sudo /usr/lib6464/nagios/plugins/check_rhcs -c
command[check_rhcs_service]=sudo /usr/lib6464/nagios/plugins/check_rhcs -s '$ARG1$'

command[get_rhcs_fencing]=test ! -p /tmp/fence_manual.fifo
command[check_rhcs_fencing]=/usr/lib6464/nagios/plugins/check_rhcs_manualfencing.sh


command[get_rhcs_cman_group]=/sbin/group_tool ls '$ARG1$' '$ARG2$'
command[get_rhcs_cman_group_default]=/sbin/group_tool ls 0 default
command[get_rhcs_cman_group_rgmanager]=/sbin/group_tool ls 1 rgmanager


command[check_rhcs_cman_group]=/usr/lib6464/nagios/plugins/check_rhcs_cman_group.sh --level '$ARG1$' --group '$ARG2$'
command[check_rhcs_cman_group_default]=/usr/lib6464/nagios/plugins/check_rhcs_cman_group.sh --level 0 --group default
command[check_rhcs_cman_group_rgmanager]=/usr/lib6464/nagios/plugins/check_rhcs_cman_group.sh --level 1 --group rgmanager


# RHEL 6 specific
command[check_rhcs6_fencing]=/usr/lib6464/nagios/plugins/check_rhcs_fence

okconfig exception when adding contact

Traceback (most recent call last):
File "/usr/bin/okconfig", line 351, in
parse_arguments()
File "/usr/bin/okconfig", line 66, in parse_arguments
addcontact()
File "/usr/bin/okconfig", line 222, in addcontact
f = okconfig.addcontact(contact_name=opts.contact, alias=opts.alias, force=opts.force, group_name=opts.group, email=opts.email)
File "/usr/lib/python2.6/site-packages/okconfig/init.py", line 273, in addcontact
contact = pynag.Model.Contact.objects.get_by_shortname(contact_name)
File "/usr/lib/python2.6/site-packages/pynag/Model/init.py", line 382, in get_by_shortname
return ObjectFetcher._cached_shortnames[self.object_type][shortname]
KeyError: 'None'

okconfig install not working

Errors:
install_nrpe.sh: line 14: get_os_release: command not found

The OS on the target host is:

NAME="Ubuntu"
VERSION="12.04.1 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.1 LTS)"
VERSION_ID="12.04"

But something tells me it's failing before that.

okconfig addservice issue

I used okconfig to set up a quick monitoring setup of 100 hosts. I did it like this:

for i in $(seq 1 100); do printf "okconfig addhost --host knc%04i --group knc-miners\n" $i; done > doit
for i in $(seq 1 100); do printf "okconfig addservice host_name=knc%04i use=okc-linux-check_ssh\n" $i; done > doit2

Sample from each file:
first file:

okconfig addhost --host knc0008 --group knc-miners
okconfig addhost --host knc0009 --group knc-miners
okconfig addhost --host knc0010 --group knc-miners
okconfig addhost --host knc0011 --group knc-miners
okconfig addhost --host knc0012 --group knc-miners

second:

okconfig addservice host_name=knc0008 use=okc-linux-check_ssh
okconfig addservice host_name=knc0009 use=okc-linux-check_ssh
okconfig addservice host_name=knc0010 use=okc-linux-check_ssh
okconfig addservice host_name=knc0011 use=okc-linux-check_ssh
okconfig addservice host_name=knc0012 use=okc-linux-check_ssh

then I just ran doit1 and then doit2 and I had what I needed to monitor these systems. I do however see an issue with the resulting config:

root@ds-0998:~# cd /etc/nagios3/okconfig/services/
root@ds-0998:/etc/nagios3/okconfig/services# ll
total 204
drwxr-xr-x 2 root root 4096 Nov 20 14:47 ./
drwxr-xr-x 5 root root 4096 Nov 6 18:33 ../
-rw-r--r-- 1 root root 197599 Nov 20 14:47 untitled.cfg

it contains:

Configuration file /etc/nagios3/okconfig/services/untitled.cfg

Edited by PyNag on Wed Nov 6 19:02:48 2013

define service {
use okc-linux-check_ssh
}

Configuration file /etc/nagios3/okconfig/services/untitled.cfg

Edited by PyNag on Wed Nov 6 19:02:48 2013

Values from templates:

check_command check_ssh

active_checks_enabled 1

obsess_over_service 1

is_volatile 0

process_perf_data 1

check_period 24x7

notification_interval 0

notification_period 24x7

failure_prediction_enabled 1

retain_status_information 1

event_handler_enabled 1

flap_detection_enabled 1

notification_options w,u,c,r

retry_check_interval 1

retain_nonstatus_information 1

notifications_enabled 1

contact_groups admins

service_description SSH Connectivity

parallelize_check 1

passive_checks_enabled 1

normal_check_interval 5

max_check_attempts 4

check_freshness 0

define service {
use okc-linux-check_ssh
host_name knc0001
}

This block is reapeated 99 more times, once for each host.

Crash bug in /okconfig/edit

Environment:

Request Method: GET
Request URL: http://localhost:8000/okconfig/edit/tandoori

Django Version: 1.4.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'adagios.okconfig_',
'adagios.objectbrowser',
'adagios.rest',
'adagios.misc')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/tommi/coding/adagios/adagios/okconfig_/views.py" in edit
  2.     form = forms.EditTemplateForm(service=service,initial=initial)
    
    File "/home/tommi/coding/adagios/adagios/okconfig_/forms.py" in init
  3.     self.command_line = service.get_effective_command_line()
    
    File "/usr/lib/python2.7/site-packages/pynag/Model/init.py" in get_effective_command_line
  4.         command = Command.objects.get_by_shortname(command_name)
    
    File "/usr/lib/python2.7/site-packages/pynag/Model/init.py" in get_by_shortname
  5.     return ObjectFetcher._cached_shortnames[self.object_type][shortname]
    

Exception Type: KeyError at /okconfig/edit/tandoori
Exception Value: 'check_nrpe'

nagios-okplugin-check_hpacucli and sudo

Add /etc/sudoers.d/check_hpacucli with:

nrpe        ALL=(ALL)       NOPASSWD: /usr/sbin/hpacucli

Modify /usr/lib64/nagios/plugins/check_hpacucli.py
-sudo=False
+sudo=True

Use sudo on remote installs

For security reasons I don't have remote root account enabled. It would be good if you could pass --sudo to the command line so that you can use a sudoer to remote in instead of root.

Not sure if you would need to have a line in sudoers for nopasswd or whether you can prompt for it via the new --interactive command?

New release

Is it possible to tag a new version of okconfig? I've hit some issues that are always fixed in master :)

Should groups be defined within okconfig?

Right now a few of the okconfig templates have built in groups, it is inconsitent between templates whether they are there or not. We need to decide the "right way" (TM)

cisco/hostgroups.cfg:define hostgroup {
cisco/hostgroups.cfg-   name    cisco-hostgroup
--
hp/hpasm/groups.cfg:define servicegroup {
hp/hpasm/groups.cfg-    servicegroup_name   proliant-services
--
hp/hpasm/groups.cfg:define contactgroup {
hp/hpasm/groups.cfg-    contactgroup_name   proliant-contacts
--
hp/eva/groups.cfg:define servicegroup {
hp/eva/groups.cfg-  servicegroup_name   eva-services
--
hp/eva/groups.cfg:define contactgroup {
hp/eva/groups.cfg-  contactgroup_name   eva-contacts
--
misc/servicegroups.cfg:define servicegroup {
misc/servicegroups.cfg- servicegroup_name           windows-services
--
misc/servicegroups.cfg:define servicegroup {
misc/servicegroups.cfg- servicegroup_name   linux-services
--
mssql/servicegroups.cfg:define servicegroup {
mssql/servicegroups.cfg-    servicegroup_name   mssql-services

Brocade template contains invalid template

okc-check-generic-brocade-prod-health isn't defined anywhere.

Found something similar

###########################################################
# Check Hardware Health on Brocade SAN Switches
define service {
        name                    check-generic-brocade-health
        use                     generic-service

        service_description     Hardware Health Status
        check_command           check_brocade_san_env
        normal_check_interval   1
        retry_check_interval    1
        #servicegroups          brocade-san-switch-health
        _SNMP_COMMUNITY         public

        #action_url             /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$

        register                0
}

install client on windows

Hi,

Is the windows client install meant to work?

I just get this:

The system cannot find the file specified.
Error: Directory /usr/share/okconfig/client/windows//nsclient not found

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.