Git Product home page Git Product logo

naemon-core's Introduction

Welcome to Naemon Core

GitHub Workflow Status

Naemon is a host/service/network monitoring program written in C and released under the GNU General Public License. It works by scheduling checks of the configured objects and then invoking plugins to do the actual checking. The plugin interface is 100% Nagios compatible, since Naemon is a fork of the aforementioned project.

Contributing

Contributing to Naemon is meant to be easy, fun and profitable. I'm not sure where the profit will come from, but if you get a warm glow of pride when getting a patch accepted, you can consider that your reward if you like.

The easiest way is probably to fork this project on github, and then send pull requests to the original project. You can also send patches to [email protected].

Commit messages

Commit messages MUST contain a Signed-off-by line and have a proper author name and email address (even though "Anonhacker42 [email protected] is considered "proper" in these circles). If you run git commit -s you'll get the signed-off-by for free. The signed-off-by indicates that you're telling us you have the right to submit this patch and that we shouldn't worry about lawyers from whatever company you're working for will come at us later and demand that we remove your contributions from the code. It might not be much of a protection against such things, but it's more or less standard praxis in the git-using projects, so please just stick to it, ok?

Messages MUST contain a brief statement of why the change was made. "Fix bugs" is a bad message, as it means people will have to know which bugs you're fixing. "Make sure we don't segfault when the disk is full" is a useful message, because it points to a problem and makes it clear that the patch should fix it. In case deep analysis was required in order to figure out the root cause of the problem, you're encouraged to also write your findings there. It also makes it look as if you did a whole lot of work and did it thoroughly, which is pretty good for your resumé.

Messages SHOULD be written in imperative form, as if you're giving the code orders on how it should change. It provides a much nicer basis for discussion when a patch has to be reviewed online, as it indicates that the change is about to take place but is open for discussion rather than that it already has and that discussion isn't welcome.

Messages SHOULD have lines shorter than 72 chars. Most of the time, people will inspect logs or blame output in a terminal or in a limited width program, and it's a pain to have to scroll sideways all the time to see the message. Please keep the lines short and it'll save some annoyance on behalf of other people.

Coding standards

Common sense applies.

  • Don't break backwards compatibility without a really good reason.
  • Don't remove or alter API's unless absolutely necessary.
  • Don't write huge functions that do a lot. It's hard to test those, and we do like tests.
  • Use the indentation already found in the files, or reindent to your liking and then run "sh indent-all.sh" when you're done. That should bring the tree back to some semblance of unity.
  • Avoid sending patches with a lot of whitespace changes. They're hard to review so they probably won't be.
  • Don't engage in useless codechurn. If the patch you're submitting doesn't solve an actual problem or paves the way for solving some sort of problem or adding a feature, it's most likely not worth the trouble.

Development environment

We provide a predefined configuration for Visual Studio Code here. These will help you to start Naemon inside an IDE within a few steps. In case you are not a huge fan of VS Code, there is also an external documentation available explaining the whole process for the Eclipse IDE.

Installing Naemon

We build packages for the most common operating systems. For more instructions follow the documentation on naemon.io.

Compiling Naemon

In order to compile Naemon a number of dependencies are required. For reference, see the following documentation on naemon.io.

After installing the required dependencies, Naemon can be compiled using the following steps.

./autogen.sh
make
sudo make install

More info

Visit the Naemon homepage at https://www.naemon.io

naemon-core's People

Contributors

ageric avatar anfoe1111 avatar atj avatar catharsis avatar ccztux avatar dereckson avatar dirtyren avatar dwittenberg2008 avatar jabdr avatar jacobbaungard avatar jbreams avatar jryberg avatar kjetilho avatar midnight-run avatar nook24 avatar ntangop5 avatar ozamosi avatar palli avatar philrandal avatar pvdputte avatar rhagman avatar ricardomaraschini avatar roelvanmeer avatar shahn avatar sjoegren avatar sni avatar stromsoe avatar tomas-edwardsson avatar tonvoon avatar wampire 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

naemon-core's Issues

checkconfig bails out on warnings

While the v0.8.0 exits with rc 0 when there are only warnings, the current head exists witht rc 1 which breaks all kind of things like init scripts etc...

HEAD:

.../naemon-core/naemon/naemon -pv .../naemon/naemon.cfg
Warning: Duplicate definition found for service 'PING' on host 'child' (config file '.../etc/naemon/conf.d/test.cfg', starting on line 509)
   Error processing object config files!

***> One or more problems was encountered while processing the config files...

Expected behaviour:

.../naemon-core/naemon/naemon -pv .../naemon/naemon.cfg
...
Total Warnings: 9
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

git-bisect returns the following commits which likely introduced this behaviour. I think especcially the last one is interesting:
The first bad commit could be any of:
1b039a5
916c8bc
f38eb33
ff5af75
4252ca0
9945dc5
9a87f92

Macro $SERVICEGROUPNAME$ is not filled

I'm writing own notification script send_notification which uses the $SERVICEGROUPNAME$ macro. I've just discovered that this macro is not filled with real value, it returns just '$SERVICEGROUPNAME$' string.
Other macros are OK.

Using naemon-core 1.0.0.

This is an extract from my debug:

[1426074272.722132] [2048.1] [pid=12332] **** BEGIN MACRO PROCESSING ***********
[1426074272.722138] [2048.1] [pid=12332] Processing: 
'$USER100$/send_notification 
--object='$ARG1$' 
--type='$ARG2$' 
--n_hostname='$HOSTNAME$' 
--n_hostdisplayname='$HOSTDISPLAYNAME$' 
--n_hostalias='$HOSTALIAS$' 
...
--n_servicegroupname='$SERVICEGROUPNAME$' 
--n_servicegroupnames='$SERVICEGROUPNAMES$' "

[1426074272.722881] [2048.1] [pid=12332]   Done.  Final output: 
'/usr/local/naemon/libexec-gtsnx/send_notification 
--object='service' 
--type='sms' 
--n_hostname='NAEMON' 
--n_hostdisplayname='NAEMON' 
--n_hostalias='NAEMON process' 
...
--n_servicegroupname='$SERVICEGROUPNAME$' 
--n_servicegroupnames='' 
...
[1426074272.722921] [2048.1] [pid=12332] **** END MACRO PROCESSING *************

[error] Caught exception in engine "You requested a stash, but one does not exist.

Hi Andreas Ericsson
I hope you remember me. We worked on few discussions of Op5 when I was working for Comcast. I hope everything is going well with Naemon. Wish you good luck.

I noticed following when doing yum update from 0:0.8.1_20141125-1-to-1.0.0 I got following error:

Haven't looked at what was broken (or) didn't try clean setup of v1.0.0.

 Updating   : naemon-thruk-libs-1.0.0-1.el6.x86_64                             1/18
[error] Caught exception in engine "You requested a stash, but one does not exist. at /usr/lib64/naemon/perl5/Catalyst.pm line 517"
Can't call method "request" on an undefined value at /usr/lib64/naemon/perl5/Plack/Test/MockHTTP.pm line 29.

More details:

[root@naemon1 ~]# yum update --disablerepo=* --enablerepo=lab*
Loaded plugins: fastestmirror
Setting up Update Process
Determining fastest mirrors
labs_consol_testing                                                                                                                                  |  951 B     00:00
labs_consol_testing/primary                                                                                                                          |  16 kB     00:00
labs_consol_testing                                                                                                                                                   28/28
Resolving Dependencies
--> Running transaction check
---> Package libnaemon.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package libnaemon.x86_64 0:1.0.0-1.el6 will be an update
---> Package mod_gearman.x86_64 0:1.4.15_beta_20140108-1.el6 will be updated
---> Package mod_gearman.x86_64 0:2.1.3_beta_20150217-1.el6 will be an update
---> Package naemon.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon.x86_64 0:1.0.0-1.el6 will be an update
---> Package naemon-core.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon-core.x86_64 0:1.0.0-1.el6 will be an update
---> Package naemon-livestatus.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon-livestatus.x86_64 0:1.0.0-1.el6 will be an update
---> Package naemon-thruk.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon-thruk.x86_64 0:1.0.0-1.el6 will be an update
---> Package naemon-thruk-libs.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon-thruk-libs.x86_64 0:1.0.0-1.el6 will be an update
---> Package naemon-thruk-reporting.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon-thruk-reporting.x86_64 0:1.0.0-1.el6 will be an update
---> Package naemon-tools.x86_64 0:0.8.1_20141125-1.el6 will be updated
---> Package naemon-tools.x86_64 0:1.0.0-1.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================
 Package                                      Arch                         Version                                          Repository                                 Size
============================================================================================================================================================================
Updating:
 libnaemon                                    x86_64                       1.0.0-1.el6                                      labs_consol_testing                        37 k
 mod_gearman                                  x86_64                       2.1.3_beta_20150217-1.el6                        labs_consol_testing                       291 k
 naemon                                       x86_64                       1.0.0-1.el6                                      labs_consol_testing                       3.0 k
 naemon-core                                  x86_64                       1.0.0-1.el6                                      labs_consol_testing                       290 k
 naemon-livestatus                            x86_64                       1.0.0-1.el6                                      labs_consol_testing                       173 k
 naemon-thruk                                 x86_64                       1.0.0-1.el6                                      labs_consol_testing                       4.2 M
 naemon-thruk-libs                            x86_64                       1.0.0-1.el6                                      labs_consol_testing                        11 M
 naemon-thruk-reporting                       x86_64                       1.0.0-1.el6                                      labs_consol_testing                       131 k
 naemon-tools                                 x86_64                       1.0.0-1.el6                                      labs_consol_testing                       502 k

Transaction Summary
============================================================================================================================================================================
Upgrade       9 Package(s)

Total download size: 17 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): libnaemon-1.0.0-1.rhel6.x86_64.rpm                            (0%) 76% [============================================-              ]  23 kB/s |  28 kB     00:00 ET(1/9): libnaemon-1.0.0-1.rhel6.x86_64.rpm                                                                                                            |  37 kB     00:00
(2/9): mod_gearman-2.1.3_beta_20150217-1.rhel6.x86_64.rpm            (0%) 14% [========-                                                  ]  0.0 B/s |  44 kB     --:-- ET(2/9): mod_gearman-2.1.3_beta_20150217-1.rhel6.x86_64.rpm     | 291 kB     00:01
(3/9): naemon-1.0.0-1.rhel6.x86_64.rpm                        | 3.0 kB     00:00
(4/9): naemon-core-1.0.0-1.rhel6.x86_64.rpm                   | 290 kB     00:00
(5/9): naemon-livestatus-1.0.0-1.rhel6.x86_64.rpm             | 173 kB     00:00
(6/9): naemon-thruk-1.0.0-1.rhel6.x86_64.rpm                  | 4.2 MB     00:10
(7/9): naemon-thruk-libs-1.0.0-1.rhel6.x86_64.rpm             |  11 MB     00:20
(8/9): naemon-thruk-reporting-1.0.0-1.rhel6.x86_64.rpm        | 131 kB     00:00
(9/9): naemon-tools-1.0.0-1.rhel6.x86_64.rpm                  | 502 kB     00:02
-------------------------------------------------------------------------------------
Total                                                440 kB/s |  17 MB     00:39
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : naemon-thruk-libs-1.0.0-1.el6.x86_64                             1/18
[error] Caught exception in engine "You requested a stash, but one does not exist. at /usr/lib64/naemon/perl5/Catalyst.pm line 517"
Can't call method "request" on an undefined value at /usr/lib64/naemon/perl5/Plack/Test/MockHTTP.pm line 29.
  Updating   : naemon-thruk-1.0.0-1.el6.x86_64                                  2/18
Stopping httpd: [  OK  ]
Starting httpd: [  OK  ]
Naemon/Thruk have been configured for http://naemon1.dsk.us/naemon/.
The default user is 'admin' with password 'admin'. You can usually change that by 'htpasswd /etc/naemon/htpasswd admin'. And you really should change that!
  Updating   : libnaemon-1.0.0-1.el6.x86_64                                     3/18
  Updating   : naemon-tools-1.0.0-1.el6.x86_64                                  4/18
  Updating   : naemon-core-1.0.0-1.el6.x86_64                                   5/18
warning: /etc/naemon/naemon.cfg created as /etc/naemon/naemon.cfg.rpmnew
warning: /etc/naemon/resource.cfg created as /etc/naemon/resource.cfg.rpmnew
  Updating   : naemon-thruk-reporting-1.0.0-1.el6.x86_64                        6/18
  Updating   : naemon-livestatus-1.0.0-1.el6.x86_64                             7/18
  Updating   : naemon-1.0.0-1.el6.x86_64                                        8/18
  Updating   : mod_gearman-2.1.3_beta_20150217-1.el6.x86_64                     9/18
warning: /etc/mod_gearman/mod_gearman_worker.conf created as /etc/mod_gearman/mod_gearman_worker.conf.rpmnew
  Cleanup    : naemon-0.8.1_20141125-1.el6.x86_64                              10/18
  Cleanup    : naemon-thruk-reporting-0.8.1_20141125-1.el6.x86_64              11/18
  Cleanup    : naemon-thruk-0.8.1_20141125-1.el6.x86_64                        12/18
Stopping thruk.... Not running.
  Cleanup    : naemon-thruk-libs-0.8.1_20141125-1.el6.x86_64                   13/18
  Cleanup    : naemon-tools-0.8.1_20141125-1.el6.x86_64                        14/18
  Cleanup    : libnaemon-0.8.1_20141125-1.el6.x86_64                           15/18
  Cleanup    : naemon-core-0.8.1_20141125-1.el6.x86_64                         16/18
  Cleanup    : naemon-livestatus-0.8.1_20141125-1.el6.x86_64                   17/18
  Cleanup    : mod_gearman-1.4.15_beta_20140108-1.el6.x86_64                   18/18
  Verifying  : naemon-thruk-1.0.0-1.el6.x86_64                                  1/18
  Verifying  : naemon-tools-1.0.0-1.el6.x86_64                                  2/18
  Verifying  : naemon-thruk-libs-1.0.0-1.el6.x86_64                             3/18
  Verifying  : libnaemon-1.0.0-1.el6.x86_64                                     4/18
  Verifying  : naemon-core-1.0.0-1.el6.x86_64                                   5/18
  Verifying  : mod_gearman-2.1.3_beta_20150217-1.el6.x86_64                     6/18
  Verifying  : naemon-livestatus-1.0.0-1.el6.x86_64                             7/18
  Verifying  : naemon-thruk-reporting-1.0.0-1.el6.x86_64                        8/18
  Verifying  : naemon-1.0.0-1.el6.x86_64                                        9/18
  Verifying  : naemon-thruk-reporting-0.8.1_20141125-1.el6.x86_64              10/18
  Verifying  : naemon-0.8.1_20141125-1.el6.x86_64                              11/18
  Verifying  : naemon-livestatus-0.8.1_20141125-1.el6.x86_64                   12/18
  Verifying  : naemon-tools-0.8.1_20141125-1.el6.x86_64                        13/18
  Verifying  : libnaemon-0.8.1_20141125-1.el6.x86_64                           14/18
  Verifying  : naemon-core-0.8.1_20141125-1.el6.x86_64                         15/18
  Verifying  : naemon-thruk-0.8.1_20141125-1.el6.x86_64                        16/18
  Verifying  : naemon-thruk-libs-0.8.1_20141125-1.el6.x86_64                   17/18
  Verifying  : mod_gearman-1.4.15_beta_20140108-1.el6.x86_64                   18/18

Updated:
  libnaemon.x86_64 0:1.0.0-1.el6
  mod_gearman.x86_64 0:2.1.3_beta_20150217-1.el6
  naemon.x86_64 0:1.0.0-1.el6
  naemon-core.x86_64 0:1.0.0-1.el6
  naemon-livestatus.x86_64 0:1.0.0-1.el6
  naemon-thruk.x86_64 0:1.0.0-1.el6
  naemon-thruk-libs.x86_64 0:1.0.0-1.el6
  naemon-thruk-reporting.x86_64 0:1.0.0-1.el6
  naemon-tools.x86_64 0:1.0.0-1.el6

Complete!

Revomve enable_environment_macros is a bad idea!

Hi guys,
i installed current Naemon Core 1.0.0 today and enable_environment_macros seems to be removed. The parameter in naemon.cfg still exists but if i enable it my envoronment is still empty. In the docs is a hint like this:
command_line NAGIOS_HOSTNAME="$HOSTNAME$" /

The problem is Naemon uses execvp() to execute my notification script and execvp is not able to handle export of variables.

Now i need to use some ugly stuf like /bin/bash -c 'NAGIOS_HOSTNAME="$HOSTNAME$"' wich will fail if $CONTACTALIAS$ is some like Bob's Contact, because $CONTACTALIAS$ is not in the list of striped macros.

Was enable_environment_macros really removed or is it just broken?

All these problems are gone with env macros, and ther was a way to turn it on or off. No Problem with ' " | $ or something else

//Edit: Or may be create a new config variable were the user can define, wich macros sould be exported to the env. Than Naemon dont net to set 200 macros where the user only uses two of them.

Plugins execvp problem (for macros)

Hello,

According to the manual you should use this syntax for using macros as environment variables.

define command {
command_name check_hpa
command_line NAEMON_HOSTNAME=$HOSTNAME$ $USER2$/check_snmp_hpa/check_snmp_hpa.rb -H $HOSTADDRESS$ $_HOSTSNMP$ --directory /etc/naemon/conf.d/dynamic/check_snmp_hpa/
}

This doesn't work and the service generates this output.
(No output on stdout) stderr: execvp(NAEMON_HOSTNAME=SC_cswitch01, ...)
failed. errno is 2: No such file or directory

From a tip by Max Sikström he said I should use certain characters which would cause naemon to run it with system instead of execvp.

By adding $OVE at the end of the command_line it starts to work again so perhaps the heuristics for choosing between execvp and system needs to be updated to handle this incident.

Regards
Magnus

reloading leaves zombies processes

Hi,

I noticed that reloading naemon (via the init script) leaves zombies hanging out, which seem to be the running checks at the moment of the reload. Using restart does not have this effect.

I was unable to find my way through the source code to where it happens, so no PR, sorry 😞

RPMs require shadow-utils on OpenSuSe 13.1 but there's no such package

Building the RPMs from source result in a dependence on the "shadow-utils" package by the base naemon rpm. This package does not exist on OpenSuse (at least version 13.1).

The utilities provided by shadow-utils on other redhat flavors appear to be provided by the "shadow" package on OpenSuse.

Improve tests for macros

The macro library needs a total rewrite sooner or later. The mkstr isn't really thread safe (with static variables in the method to temporary store variables), and it isn't that performance efficient to resolve an array of all possible macros, if some are quite performance heavy (listing groups, counting services, counting rocks in the entire beach, and so).

To be able to rewrite the macro library, we first need to improve the test suite.

So each macro should be a part of at least one test that extracts unique information of a mocked object.

Some tests is already available in the macro test suite. Create another test suite just to test the different macros, not the explicit escaping, is preffered.

Can't login into Naemon after install.

I followed the install guide (it's missing naemon-tools btw) and after the install was complete, the GUI comes up, however after entering admin with the password I set, I get nothing. I just sit on the splash screen. I tried a made up login and I get invalid login, but with the correct credentials I just stay at the splash, no errors.

Suggestions?

remote ansible restart won't start

I've noticed a peculiar thing when trying to restart the naemon service on RHEL6 with (latest pip) ansible.
The naemon service will stop but it won't start unless restarting twice.
When running restart on the actual naemon server the service will restart as expected.
I've never seen this behaviour with any other service so I think this is naemon init related.

disabled host_checks and mod_gearman: seg_fault in 'is_host_member_of_hostgroup()'

When broker_module für mod_gearman (3.0b1) is enabled, naemon fails with seg_fault in 'is_host_member_of_hostgroup()', when one of the configured hosts has disabled its host_checks (check_interval 0). WIthout mod_gearman broker enabled, naemon is running fine.

gdb Backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b71094 in is_host_member_of_hostgroup () from /usr/lib64/naemon/libnaemon.so.0
(gdb) bt
#0  0x00007ffff7b71094 in is_host_member_of_hostgroup () from /usr/lib64/naemon/libnaemon.so.0
#1  0x00007ffff66af459 in set_target_queue (hst=hst@entry=0x642bd0, svc=svc@entry=0x0) at neb_module_naemon/../neb_module/mod_gearman.c:1106
#2  0x00007ffff66aff14 in handle_host_check (event_type=<optimized out>, data=0x7fffffffd9b0) at neb_module_naemon/../neb_module/mod_gearman.c:607
#3  0x00007ffff7b6807f in neb_make_callbacks () from /usr/lib64/naemon/libnaemon.so.0
#4  0x00007ffff7b485cb in broker_host_check () from /usr/lib64/naemon/libnaemon.so.0
#5  0x00007ffff7b4ccc6 in ?? () from /usr/lib64/naemon/libnaemon.so.0
#6  0x00007ffff7b4d1b7 in ?? () from /usr/lib64/naemon/libnaemon.so.0
#7  0x00007ffff7b609b7 in ?? () from /usr/lib64/naemon/libnaemon.so.0
#8  0x00007ffff7b60ece in event_poll () from /usr/lib64/naemon/libnaemon.so.0
#9  0x0000000000403345 in main ()

External command error: Invalid value

Hi!
Today I tried the lastest version of naemon v1.0.0 . Unfortunately, when naemon receive an SNMP trap, naemon sends in naemon.log :
1- Warning: External command parse error [1427256079] PROCESS_SERVICE_CHECK_RESULT;127.0.0.1;snmptrap-service;2;Link down on interface 2. Admin state: 1. Operational state: 1 (Invalid value)
2 - External command error: Invalid value
3- i have this in /var/log/snmptt/snmptt.log :
Wed Mar 25 05:38:46 2015 .1.3.6.1.6.3.1.1.5.3 Normal "Status Events" naemonbox-standalone.localdomain - Link down on interface 2. Admin state: 1. Operational state: 1
(it doesn't work for me since Naemon 0.8.0 )

warnings when running autoreconf -i: Header Present But Cannot Be Compiled

Probably I have missed to install some necessary packages on SLES11 SP3 (JeOS). But I think the WARNING should be handled like described here: http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Present-But-Cannot-Be-Compiled.html.

That's just an example WARNING. There are a lot of more warnings of the same type on my testing system.

checking arpa/inet.h usability... no
checking arpa/inet.h presence... yes
configure: WARNING: arpa/inet.h: present but cannot be compiled
configure: WARNING: arpa/inet.h:     check for missing prerequisite headers?
configure: WARNING: arpa/inet.h: see the Autoconf documentation
configure: WARNING: arpa/inet.h:     section "Present But Cannot Be Compiled"
configure: WARNING: arpa/inet.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------------------- ##
configure: WARNING:     ## Report this to [email protected] ##
configure: WARNING:     ## ---------------------------------------------- ##
checking for arpa/inet.h... no

Naemon SIGSEGV if plugin output is only a new line

Hi,
today i had a plugin that returned just a new line and this killed my naemon.

I created a new Naemon 1.0.3 box on Ubuntu 14.04 to reproduce this error, thats my result:

Successfully launched command file worker with pid 14337

Program received signal SIGSEGV, Segmentation fault.
__strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
32  ../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
(gdb)

My Naemon configuration only contains 1 host with 1 service. No broker moduls like livestatus or mod_gearman, just plain Naemon.

This is my test plugin, that creates a sigsegv:

<?php
echo "\n";

It looks like that an empty output is ok for naemon, so if you use

<?php
echo "";

nothing will happen...

External Command RESTART_PROCESS not working

On some machines the RESTART_PROCESS external command just does nothing.

The debug log does not contain any useful hints:

[1464018735.672096] [128.2] [pid=8021] Raw command entry: [1464018735] RESTART_PROCESS
[1464018735.672397] [064.1] [pid=8021] Making callbacks (type 2)...
[1464018735.672758] [064.2] [pid=8021] Callback #1 (type 2) return code = 0
[1464018735.672871] [064.1] [pid=8021] Making callbacks (type 17)...
[1464018735.673011] [064.2] [pid=8021] Callback #1 (type 17) return code = 0
[1464018735.673120] [064.1] [pid=8021] Making callbacks (type 17)...
[1464018735.673246] [064.2] [pid=8021] Callback #1 (type 17) return code = 0
[1464018735.673430] [4096.2] [pid=8021] ## 1 descriptors had input
[1464018735.673527] [008.0] [pid=8021] Event was cancelled by iobroker input
[1464018735.686729] [4096.2] [pid=8021] ## 1 descriptors had input
[1464018735.686909] [008.0] [pid=8021] Event was cancelled by iobroker input
[1464018735.688423] [4096.2] [pid=8021] ## 1 descriptors had input
[1464018735.688690] [008.0] [pid=8021] Event was cancelled by iobroker input
[1464018735.690305] [4096.2] [pid=8021] ## 1 descriptors had input
[1464018735.690477] [008.0] [pid=8021] Event was cancelled by iobroker input
[1464018737.193456] [4096.2] [pid=8021] ## 0 descriptors had input
[1464018738.695988] [4096.2] [pid=8021] ## 0 descriptors had input
[1464018740.198133] [4096.2] [pid=8021] ## 0 descriptors had input
[1464018741.700197] [4096.2] [pid=8021] ## 0 descriptors had input
[1464018743.202594] [4096.2] [pid=8021] ## 0 descriptors had input
[1464018744.704749] [4096.2] [pid=8021] ## 0 descriptors had input

It basically looks the same on a machine where it is working. The error is reproducable on these machines, altought they do not seem to have any relation. The failed test vms are Fedora 23 (32bit) Sles 11SP2 (64bit) and Ubuntu16.04 (32bit). All other test VMs are ok.

Default files

Please can you stop the default switch.cfg, printer.cfg and windows.cfg in /etc/naemon/conf.d/ from being created when updating.
These are what cause my "Naemon: ERROR: failed to open socket /var/cache/naemon/live: No such file or directory (/var/cache/naemon/live)" errors after EVERY update.
Please can you make the setup script to check to see if they are there, if not create them. If they are there, leave them alone.
Fair enough on a new install, but not when upgrading to a newer version. Thank you.

Slow startup with many hosts/services out of check period

Naemon takes multiple minutes to start with about 100 hosts and 2000 services with check_period nopowersave as defined in this config section:

define timeperiod {
        timeperiod_name                vorlesungszeit
        2014-04-01 - 2014-07-12        00:00-24:00
        2014-10-06 - 2015-01-31        00:00-24:00
        2015-04-13 - 2015-07-18        00:00-24:00
        2015-10-12 - 2016-02-06        00:00-24:00
        2016-04-11 - 2016-07-16        00:00-24:00
        2016-10-17 - 2017-02-11        00:00-24:00
}

define timeperiod {
        timeperiod_name                semesterferien
        monday                         00:00-24:00
        tuesday                        00:00-24:00
        wednesday                      00:00-24:00
        thursday                       00:00-24:00
        friday                         00:00-24:00
        saturday                       00:00-24:00
        sunday                         00:00-24:00
        exclude                        vorlesungszeit

}

define timeperiod {
        timeperiod_name                nopowersave
        monday                         08:45-20:00
        tuesday                        08:45-20:00
        wednesday                      08:45-20:00
        thursday                       08:45-20:00
        friday                         08:45-20:00
        exclude                        semesterferien
}

The debug log mostly contains the message _get_matching_timerange(), here's a short snippet of it, service foo and host bar have check_period nopowersave configured.

[1407139826.151502] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151513] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151558] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151609] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151635] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151646] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151696] [008.1] [pid=21804] Service 'foo' on host 'bar' should not be scheduled.
[1407139826.151704] [001.0] [pid=21804] check_time_against_period()
[1407139826.151712] [001.0] [pid=21804] check_time_against_period()
[1407139826.151721] [001.0] [pid=21804] check_time_against_period()
[1407139826.151730] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151772] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151781] [001.0] [pid=21804] get_next_valid_time()
[1407139826.151789] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151801] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151812] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151891] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151939] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.151982] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152024] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152068] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152111] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152155] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152199] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152241] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152280] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152292] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152335] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152412] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152456] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152499] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152542] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152584] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152628] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152659] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152691] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152722] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152765] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152875] [001.0] [pid=21804] _get_matching_timerange()
[1407139826.152944] [001.0] [pid=21804] _get_matching_timerange()

Stracing the process gives loads of stats on /etc/localtime:

stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2309, ...}) = 0

GDB backtrace while startup:

#0  0x00007f53a851ab75 in *__GI___xstat (vers=<optimized out>, name=<optimized out>, buf=0x7ffff8879000) at ../sysdeps/unix/sysv/linux/wordsize-64/xstat.c:38
#1  0x00007f53a84ea550 in __tzfile_read (file=0x7f53a859888e "/etc/localtime", extra=0, extrap=<optimized out>) at tzfile.c:173
#2  0x00007f53a84e9948 in tzset_internal (always=<optimized out>, explicit=<optimized out>) at tzset.c:439
#3  0x00007f53a84e9bc0 in __tzset () at tzset.c:592
#4  0x00007f53a84e8a09 in *__GI_mktime (tp=0x7f53a859888e) at mktime.c:515
#5  0x000000000044e13e in ?? ()
#6  0x000000000044e598 in _get_next_valid_time ()
#7  0x000000000044e701 in _get_next_valid_time ()
#8  0x000000000044e83b in get_next_valid_time ()
#9  0x0000000000432e37 in init_timing_loop ()
#10 0x0000000000417043 in main ()

Naemon version is 0.8.0 with the patch from commit ad800d8 applied, running on Debian wheezy.

error: ignoring return value of 'asprintf', declared with attribute warn_unused_result

Can't build naemon on centos6 x86_64 due to Warnings treated as errors.
=> return code for asprintf is not handeled.
See below the error and the files affected.
(As stated on the devel mailing list https://www.monitoring-lists.org/archive/naemon-dev/2014-May/000139.html, better fix the code than remove the -Werror)

gcc -DHAVE_CONFIG_H -I. -I.. -I../naemon/lib -D_GNU_SOURCE -I.. '-DSYSCONFDIR="/etc/naemon"' '-DLOCALSTATEDIR="/var/lib/naemon"' '-DLOGDIR="/var/log/naemon"' '-DLOCKFILE="/var/run/naemon/naemon.pid"' -DPREFIX='"/usr"' -Wall -Werror -fPIC -Wextra -pipe -ggdb3 -Wredundant-decls -Wtrigraphs -Wdeclaration-after-statement -Wshadow -Wstrict-prototypes -Wno-unused-result -Wno-unused-parameter -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -MT naemon-naemon.o -MD -MP -MF .deps/naemon-naemon.Tpo -c -o naemon-naemon.o test -f 'naemon.c' || echo './'naemon.c
cc1: warnings being treated as errors
naemon.c: In function 'test_path_access':
naemon.c:94: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c: In function 'nagios_core_worker':
naemon.c:148: error: ignoring return value of 'read', declared with attribute warn_unused_result
naemon.c: In function 'main':
naemon.c:547: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c:763: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
At top level:
cc1: error: unrecognized command line option "-Wno-unused-result"
make[5]: *** [naemon-naemon.o] Error 1

=> doing make -k in the build directory show that the problem is in the following files:
naemon.c:94: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c:148: error: ignoring return value of 'read', declared with attribute warn_unused_result
naemon.c:547: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
naemon.c:763: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:398: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:416: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:418: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2219: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2246: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
commands.c:279: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:280: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:869: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:43: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:104: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:109: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:116: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:121: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:152: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:170: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:185: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:210: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:222: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:236: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:292: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:303: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:314: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:325: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:336: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:347: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:358: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:369: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:380: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:403: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:412: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:423: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:436: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:466: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:477: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:488: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:504: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:522: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:533: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:544: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:555: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:566: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:577: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:586: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:608: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:626: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:664: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:675: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:693: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:704: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:725: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:735: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:745: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:759: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:768: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:784: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:795: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:806: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:817: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:829: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:839: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:846: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:858: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:868: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:878: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:889: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:908: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:918: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:928: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:938: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:999: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1010: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1117: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1402: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
downtime.c:421: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
downtime.c:423: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
flapping.c:225: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
flapping.c:308: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:238: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:266: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:293: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:326: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:381: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
logging.c:458: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1163: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1164: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1165: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1166: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1167: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1168: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1169: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1170: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1171: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1172: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1173: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1174: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1175: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1176: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1177: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1178: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:1661: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:2028: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:2214: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3093: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3120: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3134: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3147: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3176: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
macros.c:3200: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
nerd.c:346: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:197: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:203: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:745: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:748: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:751: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:754: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:757: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:760: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:763: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:766: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:769: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1135: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1141: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1639: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1642: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1645: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1648: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1651: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1654: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1657: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1660: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
notifications.c:1663: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
query-handler.c:39: error: ignoring return value of 'write', declared with attribute warn_unused_result
sehandlers.c:243: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
sehandlers.c:343: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
sehandlers.c:486: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
sehandlers.c:585: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
utils.c:419: error: ignoring return value of 'write', declared with attribute warn_unused_result
utils.c:426: error: ignoring return value of 'write', declared with attribute warn_unused_result
utils.c:1590: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
utils.c:1592: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
utils.c:1679: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result
utils.c:1681: error: ignoring return value of 'write', declared with attribute warn_unused_result
utils.c:1860: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
utils.c:2074: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:461: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:675: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:677: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
workers.c:682: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xodtemplate.c:256: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xodtemplate.c:274: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xrddefault.c:94: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
xsddefault.c:106: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:398: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:416: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:418: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2219: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
checks.c:2246: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
commands.c:279: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:280: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
commands.c:869: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:43: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:104: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:109: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:116: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:121: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:152: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:170: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:185: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:210: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:222: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:236: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:292: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:303: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:314: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:325: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:336: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:347: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:358: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:369: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:380: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:403: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:412: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:423: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:436: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:466: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:477: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:488: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:504: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:522: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:533: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:544: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:555: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:566: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:577: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:586: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:608: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:626: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:664: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:675: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:693: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:704: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:725: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:735: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:745: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:759: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:768: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:784: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:795: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:806: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:817: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:829: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:839: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:846: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:858: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:868: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:878: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:889: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:908: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:918: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:928: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:938: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:999: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1010: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1117: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1391: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result
configuration.c:1402: error: ignoring return value of 'asprintf', declared with attribute warn_unused_result

Custom Variable Macros and hostgroups

Hello,

I think it would be really useful if you could specify custom variable macros on hostgroups that would be inherited by all hosts in that host group.

Currently adding a variable macro to a hostgroup causes a configuration error.

Like this for example. My own plugins use this a lot. Currently I have the standard values in the plugin itself and if the environment variable exists I use that instead. For me it is much simpler than using $ARG1$ on each host. This way I only have to specify the threshold on those hosts that cant use the standard for some reason like undersized appliances and such.

define hostgroup {
hostgroup_name obj_checkpoint
_CPFWCPULEVELS warn=75,crit=90,duration=3600
}

Regards
Magnus

Memory leak while sending custom notifications

Sending at least a custom host notificaiton gives a memory leak, caused by a strdup in the command handler for the field author and data.

Valgrind output:

==540== 10 bytes in 1 blocks are definitely lost in loss record 23 of 349
==540== at 0x4C279EE: malloc (vg_replace_malloc.c:270)
==540== by 0x5338171: strdup (strdup.c:43)
==540== by 0x422417: process_host_command (commands.c:1438)
==540== by 0x422EAE: process_external_command1 (commands.c:886)
==540== by 0x446032: qh_command (query-handler.c:351)
==540== by 0x446315: qh_input (query-handler.c:193)
==540== by 0x473455: iobroker_poll (iobroker.c:364)
==540== by 0x430B30: event_execution_loop (events.c:1062)
==540== by 0x414D53: main (naemon.c:768)
==540==
==540== 10 bytes in 1 blocks are definitely lost in loss record 24 of 349
==540== at 0x4C279EE: malloc (vg_replace_malloc.c:270)
==540== by 0x5338171: strdup (strdup.c:43)
==540== by 0x422437: process_host_command (commands.c:1441)
==540== by 0x422EAE: process_external_command1 (commands.c:886)
==540== by 0x446032: qh_command (query-handler.c:351)
==540== by 0x446315: qh_input (query-handler.c:193)
==540== by 0x473455: iobroker_poll (iobroker.c:364)
==540== by 0x430B30: event_execution_loop (events.c:1062)
==540== by 0x414D53: main (naemon.c:768)

LSB compatible init script

According to LSB, init script status action should return 3 if the service is not running. Currently it returns 1.

naemon(1.0.4) cannot load module mod_gearman2(2-2.1.5-1) not loading with

Hello,

I have just tried naemon 1.0.4 from the consol labs repo in our dev environment. Naemon fails to start with the message.

/var/log/naemon/naemon.log
[1465184045] Error: Could not load module '/usr/lib64/mod_gearman2/mod_gearman2.o' -> /usr/lib64/mod_gearman2/mod_gearman2.o: undefined symbol: clear_volatile_macros
[1465184045] Error: Failed to load module '/usr/lib64/mod_gearman2/mod_gearman2.o'.
[snip]
[1465184045] Error: Module loading failed. Aborting.

OS: Red Hat Enterprise Linux Server release 7.2 (Maipo)
naemon: 1.0.4
mod_gearman2: 2.1.5-1

Is their any other information I can supply? Regards, Danny

naemon.zip

notification intervals for contacts

Requesting a notification_interval for contacts and/or contact_groups.

Use case:
for example there is one service with notification_interval 10, but one of the contacts/contact_groups wants to get notifications every 24h or 3 days , etc. So i have some options either duplicate service definitions which is kind of nonsense or define escalations for every use case or write my own handlers, in all of those cases there is too big overhead. Having the possibility to define notification_interval to contacts or contact_groups would be tremendous help.

Allow exclude (!) to work for regexp matches as well

Since I'll be trying naemon as well, I'm hoping to include the following feature as well:
for regex, the exclude ('!') doesn't work, so you can't say something like e.g. for hosts:
.,!bt.
(include every host, but exclude those starting with bt)
The original patch (never made it into nagios I think) can still be found here:
http://permalink.gmane.org/gmane.network.nagios.devel/5338
I updated this patch and sent it to icinga and it got included:
https://dev.icinga.org/issues/3720
So, if you're interested, I can create a patch for naemon as well (or you guys can do it)?

naemon not failing on "Error: Unexpected token or statement in file" in specific cases

Naemon v1.0.3 tells you Things look okay even when it finds Error: Unexpected token or statement in file earlier in the pre-flight check on configuration data and exits with exit code 0.

This can lead naemon to run with significant chunks of your config missing which is a big problem.

Output on naemon -v naemon.cfg (the Total Errors: 0 is the problem here):

Naemon Core 1.0.3-source
Copyright (c) 2013-present Naemon Core Development Team and Community Contributors
Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
License: GPL

Website: http://www.naemon.org
Reading configuration data...
   Read main config file okay...
Error: Unexpected token or statement in file '/tmp/simple-test.cfg' on line 58.
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Warning: Service 'dummy' on host 'localhost' has no check time period defined!
Warning: Service 'dummy' on host 'localhost' has no notification time period defined!
    Checked 1 services.
    Checked 1 hosts.
    Checked 0 host groups.
    Checked 0 service groups.
Warning: Contact 'devnull' has no service notification time period defined!
Warning: Contact 'devnull' has no host notification time period defined!
    Checked 1 contacts.
    Checked 0 contact groups.
    Checked 1 commands.
    Checked 0 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
Checking for circular paths...
    Checked 1 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 0 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 4
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

To reproduce this you can use this example /tmp/simple-test.cfg (please note the defin host { line at the bottom - the misspelled define here should always lead to an error):

define command {
  command_name         dummy
  command_line         /bin/true
}
define host {
  name                 base
  register             0
  max_check_attempts   1
  check_command        dummy
  contacts             devnull
}
define host {
  use                  base
  host_name            localhost
  alias                localhost
  address              127.0.0.1
}
define service {
  name                 base
  register             0
  max_check_attempts   1
  contacts             devnull
}
define service {
  use                  base
  service_description  dummy
  check_command        dummy
  host                 localhost
}
define contact {
  name                            base
  register                        0
  host_notifications_enabled      0
  service_notifications_enabled   0
  can_submit_commands             1
  retain_status_information       0
  retain_nonstatus_information    0
  host_notification_commands      dummy
  service_notification_commands   dummy
  #host_notification_period        24x7
  #service_notification_period     24x7
}
define contact {
  use           base
  contact_name  devnull
  alias         Devnull Blackhole
}
defin host {
  use            base
  host_name      define-typo
  alias          define-typo
  address        127.0.0.1
}

Case 1 - if you include the config above in your naemon.cfg as follows naemon fails as it should:

cfg_file=/tmp/simple-test.cfg
...
   Error processing object config files!
...

Case 2 - if you include the config above in your naemon.cfg as follows naemon fails as it should:

cfg_file=/tmp/simple-test.cfg
cfg_dir=/tmp/emptydir
...
   Error processing object config files!
...

Case 3: if you include the config above in your naemon.cfg as follows naemon is happy, but shouldn't:

cfg_dir=/tmp/emptydir
cfg_file=/tmp/simple-test.cfg
...
Total Warnings: 4
Total Errors:   0
Things look okay - No serious problems were detected during the pre-flight check
...

SIGSEGV

Hi!

Today I tried the lastest (testing) version of omd-nc (new cores), which includes naemon. Unfortunately, after a minute (or so), naemon ends itself with a SIGSEGV:

[1390996174] Caught SIGSEGV, shutting down...

I guess this will be quite hard to reproduce for you, but I'm totally willing to support you in any way that doesn't (really) compromise my security!

Best,
Oliver

signal handling changes for 1.0.4 - naemon exits on USR1 to the master process

I updated to naemon 1.0.4 on an up to date Debian jessie using packages from http://labs.consol.de/repo/stable/debian. I'm seeing naemon die every morning after log rotation completes. I have verified that if I send SIGUSR1 to the master process, it goes through the shutdown process and exits. I tried to attach to the main process with strace, but that also caused it to go through the shutdown process.

The last entries in naemon.log after it exits are:

[1465237272] Auto-save of retention data completed successfully.
[1465237280] EXTERNAL COMMAND: SCHEDULE_HOST_CHECK;guesthouse.sw51f3;1465237281
[1465237379] Error: Polling for input on 0x12cd150 failed: Interrupted system call
[1465237381] Event broker module 'NERD' deinitialized successfully.
[1465237381] livestatus: deinitializing
[1465237381] Event broker module '/usr/lib/naemon/naemon-livestatus/livestatus.so' deinitialized successfully.

small RPM issues

Using the RPM build version 0.8.1_20140415 , it seems there are some issues:

  • /var/run/naemon is not being created, so the default configured PID can't be stored and thus naemon refuses to launch
  • if there are just warnings in the config files, naemon tells you it is ok, but the init script refuses to start naemon if warnings are found

shadownaemon : in_notification_period and in_check_period

Just installed naemon 1.0.4-20150509.
With shadownaemon, in_notification_period and in_check_period are always 0.
If a I desactivated shadownaemon, in_notification_period and in_check_period are equal to 1, except for hosts or services that are really out of notification or check period on the backend.

init script failed to reload naemon

Hi,

On Debian Wheezy, pkill util must have signal spec before the pattern, so reload() failed to reload.

on my installed package, the trivial diff is:

113c113
<     pkill -u ${user} -f ${exec} -HUP

---
>     pkill -HUP -u ${user} -f ${exec}

Snarf.

SCHEDULE_HOSTGROUP_HOST_DOWNTIME / Unknown hostgroup comamnd ID 84

Using 'Schedule downtime for all hosts in this hostgroup' does result in the log entry:

"Unknown hostgroup comamnd ID 84"

No downtimes are added. For me it looks like it's not implemented, yet.

naemon/commands.c

in "hostgroup_command_handler" function. No 'case' statement for SCHEDULE_HOSTGROUP_HOST_DOWNTIME

Hope this feature isn't omitted. Thank you very much.

External command RELOAD_CONFIG

Hello,

I would like to be able to reload the configuration through the external command file.

Preferably aborted if there is any parse errors in the configuration.

Regards
Magnus

Naemon 1.04 Centos won't send any notification

Hi,
I've installed Naemon 1.04 from consol labs repo on my Centos7 server and I couldn't send any notificatios despite naemon claims in debug he sent them.

cat /var/lib/naemon/naemon.debug
..
[Sat Jun  4 20:22:05 2016.155755] [032.0] [pid=29642] ** Service Notification Attempt ** Host: 'test.domain.local', Service: 'Check MariaDB Cluster Size', Type: CUSTOM, Options: 2, Current State: 0, Last Notification: Thu Jan  1 01:00:00 1970
[Sat Jun  4 20:22:05 2016.155780] [032.1] [pid=29642] This is a forced service notification, so we'll send it out.
[Sat Jun  4 20:22:05 2016.155786] [032.0] [pid=29642] Notification viability test passed.
[Sat Jun  4 20:22:05 2016.155801] [032.1] [pid=29642] Current notification number: 0 (changed)
[Sat Jun  4 20:22:05 2016.155840] [032.2] [pid=29642] Creating list of contacts to be notified.
[Sat Jun  4 20:22:05 2016.155848] [032.1] [pid=29642] Service notification will NOT be escalated.
[Sat Jun  4 20:22:05 2016.155853] [032.1] [pid=29642] Adding normal contacts for service to notification list.
[Sat Jun  4 20:22:05 2016.155857] [032.2] [pid=29642] Adding members of contact group 'admins' for service to notification list.
[Sat Jun  4 20:22:05 2016.155862] [032.2] [pid=29642] ** Checking service notification viability for contact 'myuser'...
[Sat Jun  4 20:22:05 2016.155867] [032.1] [pid=29642] This is a forced service notification, so we'll send it out to this contact.
[Sat Jun  4 20:22:05 2016.155870] [032.2] [pid=29642] Adding contact 'myuser' to notification list.
[Sat Jun  4 20:22:05 2016.155887] [032.2] [pid=29642] ** Notifying contact 'myuser'
[Sat Jun  4 20:22:05 2016.155901] [032.2] [pid=29642] Raw notification command: /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
[Sat Jun  4 20:22:05 2016.155955] [032.2] [pid=29642] Processed notification command: /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: CUSTOM\n\nService: Check MariaDB Cluster Size\nHost: Devel Primary Database Server\nAddress: 192.168.100.50\nState: OK\n\nDate/Time: Sat Jun 4 20:22:05 CEST 2016\n\nAdditional Info:\n\nOK wsrep_cluster_size = 2\n" | /usr/bin/mail -s "** CUSTOM Service Alert: Devel Primary Database Server/Check MariaDB Cluster Size is OK **" [email protected]
[Sat Jun  4 20:22:05 2016.156022] [032.0] [pid=29642] 1 contacts were notified.

But there is no trace of calling mail in /var/log/maillog
I even tried to change notification command to just simply create file in /tmp but no luck.

After downgrading to Naemon 1.03 everything OK and notification working again.

Inherit more service attributes from its host

Currently only the attributes contact_groups, notification_interval and notification_period of a service are inherited from the corresponding host, see http://www.naemon.org/documentation/usersguide/objectinheritance.html#implied_inheritance

I'd like to see the same behavior for some other attributes too, in my case I need this for check_period as I monitor some services on many hosts where only some are turned off at night and currently I have to duplicate the service definitions for them which seems unnecessary.

Implementing this shouldn't break any existing setups as having no check_period specified in a service is not allowed at the moment. If you give me some hints on where to look at the source code, I'd be willing to work on a patch.

Problem to compile naemon at FreeBSD

Hi,
I'm trying to compile Naemon at FreeBSD 10.2 and I'm getting the following error:

./configure: 12293: Syntax error: word unexpected (expecting ")")

[root@ ~/naemon]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gawk... (cached) gawk
checking whether make sets $(MAKE)... (cached) yes
checking build system type... amd64-unknown-freebsd10.2
checking host system type... amd64-unknown-freebsd10.2
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/local/bin/ld
checking if the linker (/usr/local/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking how to convert amd64-unknown-freebsd10.2 file names to amd64-unknown-freebsd10.2 format... func_convert_file_noop
checking how to convert amd64-unknown-freebsd10.2 file names to toolchain format... func_convert_file_noop
checking for /usr/local/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/local/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... freebsd10.2 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
./configure: 12293: Syntax error: word unexpected (expecting ")")

What am I doing wrong?

Thanks in advance.

Odd behaviour when escaping macros with odd number of dollar characters

When you tell naemon to expand macros in the string How are $ escaped?, it will return How are $ escaped?$, with a trailing dollar sign.

This is unexpected - on the other hand, it's also undefined - but I'm not sure what is the most correct thing to do:

  • Report an error - this would most likely break a ton of stuff.
  • Return the exact string you gave it.
  • Do nothing - there's no behaviour so obscure that nobody relies on it, but I don't know how long this behaviour has existed.

I'm leaning towards option 2, but I'd like someone to tell me whether it makes sense or not before I implement anything. Perhaps I'm forgetting about something?

[shadownaemon] GET status fails due to missing 'external_commands' and 'external_commands_rate' columns

OS: Debian Wheezy (3.2.60-1+deb7u3 x86_64)
naemon-core: 1.0.0
naemon-livestatus: 1.0.0
naemon-tools: 1.0.0

Master

root@naemon-master:~# shadownaemon -v -i 10.20.73.242:9000 -o /tmp/shadowcache
query: GET status
query: Columns: accept_passive_host_checks accept_passive_service_checks check_external_commands check_host_freshness check_service_freshness enable_event_handlers enable_flap_detection enable_notifications execute_host_checks execute_service_checks last_log_rotation nagios_pid obsess_over_hosts obsess_over_services process_performance_data program_start program_version interval_length connections connections_rate external_commands external_commands_rate forks forks_rate host_checks host_checks_rate neb_callbacks neb_callbacks_rate requests requests_rate service_checks service_checks_rate log_messages log_messages_rate cached_log_messages last_command_check
query: ResponseHeader: fixed16
KeepAlive: on
Separators: 1 2 5 6
query failed: 400
query:

---
GET status

---
[0.4223 (+0.0402)] got -1 rows
updating program status failed
Event broker module '/usr/lib/naemon/naemon-livestatus/livestatus.so' deinitialized successfully.
Warning: Cannot open log file '(null)' for writing
remote site went offline, waiting 30seconds

Remote

root@naemon-remote:~# tail -f /var/log/naemon/livestatus.log
2015-03-17 13:51:07 error: Table 'status' has no column 'external_commands'

Inconsistent code/docs for host check_period

The docs on host objects list check_period as a required attribute but Naemon starts fine (even without warnings) if it's not set. In this case I guess it works just like if the time period was set to 24x7.

For services there is a check at naemon/configuration.c:1505 but for hosts there is only a check at naemon/configuration.c:1585 which only checks whether the timeperiod is valid if any is given.

This behavior should either be changed or documented. There might be similar problems for other attributes but check_period was the only one I looked at.

warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS'

On a SLES11 SP3 I got the following warnings while running autoreconf -i (autoconf-2.69-40.1).

naemon/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
naemon/lib/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

help2man not found in make-all in current master

Hi, not sure if this is the right place to post... I installed the current master right now on Ubuntu 14.04 with./configure;make-all;make install and got this little error:

/bin/bash /root/naemon0.9/naemon.0.9/missing help2man --no-info --section=8 --help-option=-h -n "monitoring core" ./src/naemon/naemon > naemon.8
/root/naemon0.9/naemon.0.9/missing: Line 81: help2man: Command not found.
WARNING: 'help2man' is missing on your system.
You should only need it if you modified a dependency of a man page.
You may want to install the GNU Help2man package:
http://www.gnu.org/software/help2man/

May be you can add this to the configure like gperf
Issue fixed by apt install help2man
Best regards,
Daniel

t-tap tests are not run on 'make check'

There are a bunch of tests in the t-tap directory that are no longer run. That is unfortunate since at least some of them are useful.

Is this intentional? If so, what are the plans on porting those tests to whatever framework we're supposed to use instead?

external command RESTART_PROGRAM with comments

Hi,
I would like to put a comment for external command "RESTART_PROGRAM", just for information why someone/something have issued it. Is it possible to add it as parameter in this command please?

BR,

Vladimir

Service Action "Send custom service notification" does not work

No notifications are sent out when using Thruk. Sven helped me and it's not any problem with Thruk, it's something in Naemon.

naemon.log

[1400531925] EXTERNAL COMMAND: SEND_CUSTOM_SVC_NOTIFICATION;plex;Mount /media/nfs/md1;0;admin;fdfds
[1400531925] Unknown host command ID 160
[1400531925] Error: External command failed -> SEND_CUSTOM_SVC_NOTIFICATION;plex;Mount /media/nfs/md1;0;admin;fdfds (Command failed)

thruk.log

[2014/05/19 22:38:45][naemon.attic.dathomir.se][INFO][Thruk.Controller.cmd] [admin][] cmd: COMMAND [1400531925] SEND_CUSTOM_SVC_NOTIFICATION;plex;Mount /media/nfs/md1;0;admin;fdfds

Naemon 1.0.3 ignores retry_interval?

I'm using Naemon 1.0.3. My standard service configuration in my test enviroment is

check_interval 5
retry_interval 1
max_attempts 5

In the process of checking when an event handler triggers, I'm discovering that the service I'm checking is "retrying" every 5 minutes, not every 1 minute. I queried the running instance with naemon-unixcat to confirm that the running instance was really using these values and it was. Also watching the "next scheduled check" for this service in Thruk always showed the next check after the initial failure occurring 5 minutes into the future.

I'm using a configuration that is a slightly pared down copy of a config tree running properly under Nagios 3-something. This service does go through a number of templates that inherit from one another all the way down the base "Default Service" definition which is where these values are defined. I want to say template inheritance this is 4 or 5 levels deep.

I'm doing this on SLES 11.3 x86-64.

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.