Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 573 forks source link

icinga2.cmd is not a named pipe in nsca-ng #4973

Closed shellscriptcode closed 7 years ago

shellscriptcode commented 7 years ago

Hi ,

     While starting nsca-ng i get warning message that icinga2.cmd is not a named pipe. Can you please suggest how nsca-ng can be integrated with icinga2 not icinga. what options we can specify.  

Thank You,

Krunal.

dnsmichi commented 7 years ago

Hm, doesn't really sound like a bug but a configuration issue. Which icinga2 --version is running, is the command feature enabled (icinga2 feature list) and does the file exist/have proper permissions (ls -la /var/run/icinga2/cmd)?

shellscriptcode commented 7 years ago

Compiled from source as hdfs(name changed) user , hdfs group and hdfs command group.

icinga2 - The Icinga 2 network monitoring daemon (version: r2.6.0-1)

Copyright (c) 2012-2016 Icinga Development Team (https://www.icinga.org/) License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Application information: Installation root: /opt/icinga2/icinga2-2.6.0 Sysconf directory: /opt/icinga2/icinga2-2.6.0/etc Run directory: /opt/icinga2/icinga2-2.6.0/var/run Local state directory: /opt/icinga2/icinga2-2.6.0/var Package data directory: /opt/icinga2/icinga2-2.6.0/share/icinga2 State path: /opt/icinga2/icinga2-2.6.0/var/lib/icinga2/icinga2.state Modified attributes path: /opt/icinga2/icinga2-2.6.0/var/lib/icinga2/modified-attributes.conf Objects path: /opt/icinga2/icinga2-2.6.0/var/cache/icinga2/icinga2.debug Vars path: /opt/icinga2/icinga2-2.6.0/var/cache/icinga2/icinga2.vars PID path: /opt/icinga2/icinga2-2.6.0/var/run/icinga2/icinga2.pid

System information: Platform: Red Hat Enterprise Linux Server Platform version: 7.2 (Maipo) Kernel: Linux Kernel version: 3.10.0-327.10.1.el7.x86_64 Architecture: x86_64

Build information: Compiler: GNU 5.4.0 Build host: ##################

=====================================================

-rwxrwxrwx. 1 hdfs hdfs 56 Feb 2 04:17 /var/icinga2/cmd/icinga2.cmd

====================================================

Disabled features: compatlog gelf graphite influxdb opentsdb syslog Enabled features: api checker command debuglog ido-mysql livestatus mainlog notification perfdata statusdata

====================================

Compiled nginx from source as hdfs user

======================================

compiled php-5.6.30 from source with php5-fpm

======================================

Every requirement with hdfs user for icinga2 and icingaweb2.

=======================================

If i disable api gui checks does not work, at that time command goes to command pipe, but when enable it it only uses and not command pipe.

============================================

dnsmichi commented 7 years ago

So how did you ensure to create icinga2.cmd then? That fairly looks like a manual touch and chmod and not created by Icinga 2 itself.

I'd recommend to use the packages from packages.icinga.com - they'll work out of the box after running icinga2 feature enable command && systemctl restart icinga2, even with SELinux.

shellscriptcode commented 7 years ago

Stopping NSCA-ng daemon ... done. Starting NSCA-ng daemon ... nsca-ng: [DEBUG] Starting command file writer nsca-ng: [DEBUG] Using the POSIX AIO API nsca-ng: [DEBUG] Creating buffer (address: 0x2365580) nsca-ng: [WARNING] /var/icinga2/cmd/icinga2.cmd is not a named pipe nsca-ng: [DEBUG] Starting TLS server nsca-ng: [DEBUG] Listening on *:5668 done.=

=================================

earlier permission was only rw------- for icinga2.cmd , and modified due to suspect that hdfs user can not handle it that is why, i gave this path which configuring icingaweb2 setup through GUI token.

==================================

Later i also added from icignaweb2 these command transports, it updated commandstransports.ini file automatically.

gunnarbeutner commented 7 years ago

The problem is that your command file isn't a pipe - it's just a regular file. Did you create it manually (e.g. using touch)?

shellscriptcode commented 7 years ago

Nope, i created through icingaweb2 monitoring module. GUI.

shellscriptcode commented 7 years ago

Also , if i use GUI, command goes to this pipe , only one line is updated.

dnsmichi commented 7 years ago

I don't think we're coming to an end here. Please be so kind and entirely purge the command pipe file and restart Icinga 2. Then show the same ls -la cli command as requested beforehand.

rm /var/icinga2/cmd/icinga2.cmd
systemctl restart icinga2
ls -la /var/icinga2/cmd/

On a related note: This is a bug tracker, not a mailing list/forum. Next time I'd advise you to kindly jump on the community support channels before opening an issue. https://www.icinga.com/community/get-involved/

shellscriptcode commented 7 years ago

After Deleting....

===============================================================

/opt/icinga2/icinga2-2.6.0/etc/init.d/icinga2 restart Checking configuration: Done Stopping Icinga 2: .Done Starting Icinga 2: chmod: cannot access ‘/var/icinga2/cmd/icinga2.cmd’: No such file or directory Done

shellscriptcode commented 7 years ago

Is it possible to change dedicated command group?

By default Icinga will run as user 'icinga' and group 'icinga'. Additionally the external command pipe and livestatus features require a dedicated command group 'icingacmd'. You can choose your own user/group names and pass them to CMake using the ICINGA2_USER, ICINGA2_GROUP and ICINGA2_COMMAND_GROUP variables.

can i change ICINGA2_COMMAND_GROUP to hdfs?

shellscriptcode commented 7 years ago

My mistake, i was using file, i found actual command pipe, which was created during icinga setup. Thanks for involving in to issue :) 👍