nconf / nconf Goto Github PK
View Code? Open in Web Editor NEWNConf - Enterprise Nagios configurator - [NConf is not actively being developed anymore!]
Home Page: http://www.nconf.org
License: GNU General Public License v2.0
NConf - Enterprise Nagios configurator - [NConf is not actively being developed anymore!]
Home Page: http://www.nconf.org
License: GNU General Public License v2.0
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]
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
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.
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.
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.
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');
#---------------------------------------------------------------
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
Hi,
It took almost three months to figure it out.
After a fresh installation, removing a predefined host it will crash the Nconf(1.3.0).
I understand that the unused advance services causing this issue.
The trouble is it doesn't give the proper error message.
Refer to the below link: http://www.vinodraj.tech/2017/07/delete-default-host-nconf-error.html
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));
Hi,
In principle, the action_url can be set via a dropdown menu for service templates. However, only the first item can be selected here.
In contrast, for a host template, the action_url dropdown menu works correctly.
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
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)
It is currently only possible to define dependencies between Services in the GUI. It would be useful to be able to declare dependencies between,
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.
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").
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
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)');
}
}
[ 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
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?
If I want to modify some attributes in class host-template and service-template (for example action_url) I get an error Failed to modify attribute when I click Submit button.
I'm using Centos 8 and PHP 7.2
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:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.