Giter Club home page Giter Club logo

nconf's People

Contributors

cyclodex avatar gargiulo avatar jvogt-swp avatar tontonitch 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nconf's Issues

Deployment: Reloading nagios configuration (via systemctl): [FAILED] on CENTOS 7.2 x64/Nagios 4.2/NConf 1.3

Hi,
i have this output during deployment:
"system call FAILED
/usr/bin/sudo -u nagios /etc/init.d/nagios reload
Reloading nagios configuration (via systemctl): [FAILED]"

My conf:
[visudo]

Defaults requiretty

apache ALL = (nagios) NOPASSWD: /etc/init.d/nagios reload

[deployment.ini]
reload_command = "/usr/bin/sudo -u nagios /etc/init.d/nagios reload"

[shell output of the reload comamnd]
$ /usr/bin/sudo -u nagios /etc/init.d/nagios reload
Reloading nagios configuration (via systemctl): ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: nagios
==== AUTHENTICATION COMPLETE ===
[ OK ]

Did i miss something ?
Thanks
Laurent

Chaining Hostgroups with Advanced Services does not work

When creating an advanced services linked to a hostgroup which itself does not have any direct members does not work. The setup is as follows:

Advanced Service (Antivirus) <- Hostgroup (Windows) <- Hostgroups (Windows 2K, Windows 2K3, ... ) <- Members (Server1, Server2)

During config file creation Hostgroup Windows is detected as not present on collector and removed.

Services assigned to a hostgroup containing an empty hostgroup are not checked

If there is a hostgroup (HG1) to which an advanced service is assigned (AS1) which has another hostgroup assigned to it (HG2), and the HG2 hostgroup is empty on collector2, however HG1 has members (directly) on collector2 then the advanced service's relationship to HG1 is omitted from the configuration for that collector. This means that AS1 isn't checked for the members of HG1 on collector2.

We think this is due to this loop: https://github.com/nconf/nconf/blob/develop/bin/lib/NConf/DB/Read.pm#L967 as the check of the hostgroup_members having members will mistakenly undef $attr->[1] for a hostgroup containing an empty hostgroup.

mysql 8

The script does not work on mysql 8 out of the box. The grouping name as become a reserved word on mysql.

After install run the following commands

Mysql:
ALTER TABLE ConfigClasses CHANGE grouping groupingdata VARCHAR(30) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;

On bash inside the nconf dir:

find . -name '*.php' -exec sed -i -e 's/grouping/groupingdata/g' {} \

That worked for me. Thanks.

set mysql charset=utf is not woring in generate_config.php ?

when i set database charset to utf8, generate_config.php still can not create the correct config file. It write chinese word to '?' in config file . Can you give me favor ?

#main.php function.php
#-------------------------------------------------------------
$dbh = mysql_connect(DBHOST,DBUSER,DBPASS);
mysql_select_db(DBNAME);
mysql_query('set names utf8');
#---------------------------------------------------------------

PHP-MySQL support FAILED on Raspbian Stretch

I am trying to install nconf on Raspbian Stretch. I installed all pre-requisties but I am still getting PHP-MySQL support. Any one can help in this regard?

PHP 7.0.33-0+deb9u3 (cli) (built: Mar 8 2019 10:01:24) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-0+deb9u3, Copyright (c) 1999-2017, by Zend Technologies

Server version: Apache/2.4.25 (Raspbian)
Server built: 2018-11-03T18:46:19

sudo apt-get install php-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-mysql is already the newest version (1:7.0+49).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Server version: 10.1.37-MariaDB-0+deb9u1 Raspbian 9.0

Double Quotes in Queries

For whatever reason, running nconf on a Percona MySQL cluster doesn't work because of the double quotes in SQL queries (vs single quotes).

I fixed this with a simple change to include/functions.php

In the db_handler function, change...

$query = trim($query);

to...

$query = str_replace('"', "'", trim($query));

Will there be a new release?

Hi guys,

at first i want to say that I really like nconf. Good Work.

But the last Release 1.3 is more then 2 years ago. Will there be a new one or is something like that planed?

Regards

Check command dependencies must use also advanced services

When building service dependencies based on check command default_service_dependency value, nconf must look for services defined as advanced services as well.

Because advanced services are very useful to check for basic host services like SNMP, SSH or HTTP (which don't need service-dependent arguments), and a large number of high level checks depend on these basic interfaces, it's very useful to configure dependencies on it. However, when nconf builds service dependencies, only looks for services on the same host (ignoring advanced services)

Ability to define dependencies to/from advanced services

It is currently only possible to define dependencies between Services in the GUI. It would be useful to be able to declare dependencies between,

  1. Advanced Services and Advanced Services
  2. Services and Advances Services

My current set up consists of hosts mainly defined by Advanced Services with only one or two Services per host. This means my options for declaring inter-service dependencies are very limited.

erronous sql query due to wrongly set max_length

Hi,

in modify_attr_write2db.php you set a default value for max_length like this:

if(isset($_POST['max_length'])){
    $max_length = $_POST['max_length'];
}else{
    $max_length = "";
}

Updating e.g. the action_url attribute will produce a sql statement starting with

UPDATE ConfigAttrs SET attr_name = 'action_url', friendly_name = 'action URL', description = 'PNP URL (if installed)', max_length = '', poss_values = ...

where max_length is an empty string. However, in the database max_length is of type int(11) and the query fails (at least on mariaDB).
IMHO is is better to default max_length to 0 instead of an empty string (at least for attributes of type "select").

hostgroups for services not supported?

Hi,

I'm currently trying to import a nagios configuration which users services with only hostgroup_names (no host at all) and nconf is not able to import it. Are you going to implement this feature?

Best,
Andreas

deployment.ini only runs local extract, ignores the other actions

Due to a bug in the include/modules/deployment/class.deployment.php in the function history you cannot run more than one type/action. The bug is the $this->name is not always defined, so it may crash on some steps.
Original function:

  // update history log
  final public function history($message, $status) {
    if($status === TRUE)
    {
        history_add('module', 'deploy '.$this->name, $message.' (OK)');
    }
    else
    {
        history_add('module', 'deploy '.$this->name, $message.' (FAILED)');
    }
}

Fixed solution:

// update history log
final public function history($message, $status) {
    if (empty($this) || empty($this->name))
    {
            $name ="";
    }
    else
    {
            $name=$this->name;
    }

    if($status === TRUE)
    {
        history_add('module', 'deploy '.$name, $message.' (OK)');
    }
    else
    {
        history_add('module', 'deploy '.$name, $message.' (FAILED)');
    }
}

Perl hash Can't use a hash as a reference at /var/www/html/devel_nconf/bin/lib/NConf/ExportNagios.pm line 1295.*

[ Initializing NConf perl-API (library version 0.3, written by A. Gargiulo) ]
[ Copyright (c) 2006 - 2013 Sunrise Communications AG, Zurich, Switzerland ]

Can't use a hash as a reference at /var/www/html/devel_nconf/bin/lib/NConf/ExportNagios.pm line 1295.
Compilation failed in require at /var/www/html/devel_nconf/bin/generate_config.pl line 51.
BEGIN failed--compilation aborted at /var/www/html/devel_nconf/bin/generate_config.pl line 51.
tar: global: Cannot stat: No such file or directory
tar: Default_collector: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Eventhandler for service: no script selection

When editing a service, I can set "event-handler enabled". However I cannot find an option to select which script should be used to handle the event. So where can I select the script to execute?

"item_id" HAVING CLAUSE issue caused by ONLY_FULL_GROUP_BY default setting in MySQL 5.1.73

Hello NConf team!

I am setting up a new VM having all of the following: NConf v. 1.3.0 / Icinga 1.11.5 / MySQL 5.1.73 / CentOS 6.5

The default installation and configuration with sample data gives the following error when generating the Nagios config:

DBD::mysql::st execute failed: non-grouping field 'item_id' is used in HAVING clause at /var/www/html/nconf/bin/lib/NConf/DB/Read.pm line 1056.

Which is actually triggered by the following SQL query:

SELECT id_item AS item_id FROM ConfigItems,ConfigClasses
WHERE id_class=fk_id_class
AND config_class = 'host'
HAVING (SELECT fk_item_linked2 FROM ConfigItems,ItemLinks,ConfigClasses
WHERE fk_item_linked2=id_item
AND id_class=fk_id_class
AND config_class = 'nagios-collector'
AND fk_id_item=item_id) = 1

The error is actually caused by "ONLY_FULL_GROUP_BY" sql_mode global value which is seems to be currently set by default on this mysql release.

To reproduce this problem, do these steps on your own mysql prompt:

  • Take note of your current sql_mode variable value by doing: SELECT @@sql_mode;
  • Then do SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY'; and test the export. You should now see the HAVING BY error message.
  • Set back you variable by doing: SET GLOBAL sql_mode = ''; and retest nconf export, all should be fine now.

The first symptom that appears to users when this issue is being experienced is
the following error message, which is very misleading if they don't know how to enable
debug and find their way around in nconf:

Icinga 1.11.5
Copyright (c) 2009-2014 Icinga Development Team (http://www.icinga.org)
Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 06-20-2014
License: GPL

Reading configuration data...
Error: Cannot open main configuration file '/var/www/html/nconf/temp/test/Default_collector.cfg' for reading!
Error processing main config file!

TAGS:
nconf
error
Cannot open main configuration file
Default_collector.cfg
HAVING CLAUSE
item_id
id_item

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.