Wie kann ich Nagios auch übers Webinterface navigieren
Hi Leute,
ich habe folgendes Problem, ich hab Nagios soweit super eingerichtet, kann auch Dienste verwalten etc., aber ich möchte dies auch
übers Webinterface tun, ich hab mich soweit in das Problem eingelesen das ich die nötigen User und Rechte für den Ordner
/usr/local/nagios/var/rw/ in der die datei nagios.cmd liegt gemacht habe. Des weiteren habe ich auch daran gedacht check_external_commands= von 0 auf 1 zu setzen, sodass es überhaupt erlaubt ist. Aber ich bekomme immer diesen Fehler hier
Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!. Wenn jemand ne Idee hat was ich vergessen haben könnte,warum es nicht funktioniert oder wenn ihr mehr infos benötigt bin ich euch sehr dankbar, ich komm nämlich hier nicht weiter =(
mfg manu
ich habe folgendes Problem, ich hab Nagios soweit super eingerichtet, kann auch Dienste verwalten etc., aber ich möchte dies auch
übers Webinterface tun, ich hab mich soweit in das Problem eingelesen das ich die nötigen User und Rechte für den Ordner
/usr/local/nagios/var/rw/ in der die datei nagios.cmd liegt gemacht habe. Des weiteren habe ich auch daran gedacht check_external_commands= von 0 auf 1 zu setzen, sodass es überhaupt erlaubt ist. Aber ich bekomme immer diesen Fehler hier
Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!. Wenn jemand ne Idee hat was ich vergessen haben könnte,warum es nicht funktioniert oder wenn ihr mehr infos benötigt bin ich euch sehr dankbar, ich komm nämlich hier nicht weiter =(
mfg manu
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 45272
Url: https://administrator.de/contentid/45272
Ausgedruckt am: 22.11.2024 um 08:11 Uhr
6 Kommentare
Neuester Kommentar
hallo manuel!
-bist so vorgegangen, wie in dem external command file permissions-doc auf sourceforge?
http://nagios.sourceforge.net/docs/2_0/commandfile.html
Answer:
[...]will work if your web server is part of the
nagios group. Is it? Have you restarted your web server since adding it
to that group? If not, you should read the documentation on External
Commands, specifically the page about setting proper permissions.
There's nothing magical about it and it follows standard unix file
permission logic.
Make sure the sticky bit is on /usr/local/nagios/var/rw directory. Also, make sure that the webserver which may be called 'wwwrun' is part of the same group as nagios. Then, it should work with no problems.
(quelle: nagiosexchange.org -forum)
saludos
gnarff
-bist so vorgegangen, wie in dem external command file permissions-doc auf sourceforge?
http://nagios.sourceforge.net/docs/2_0/commandfile.html
Answer:
[...]will work if your web server is part of the
nagios group. Is it? Have you restarted your web server since adding it
to that group? If not, you should read the documentation on External
Commands, specifically the page about setting proper permissions.
There's nothing magical about it and it follows standard unix file
permission logic.
Make sure the sticky bit is on /usr/local/nagios/var/rw directory. Also, make sure that the webserver which may be called 'wwwrun' is part of the same group as nagios. Then, it should work with no problems.
(quelle: nagiosexchange.org -forum)
saludos
gnarff
1.External Command File
Format: command_file=<file_name>
Example: command_file=/usr/local/nagios/var/rw/nagios.cmd
This is the file that Nagios will check for external commands to process. The command CGI writes commands to this file. Other third party programs can write to this file if proper file permissions have been granted as outline in here. The external command file is implemented as a named pipe (FIFO), which is created when Nagios starts and removed when it shuts down. If the file exists when Nagios starts, the Nagios process will terminate with an error message.
-Da die nagios.cmd eine Pipe ist, wird die Datei beim Starten von Nagios angelegt.
2. Enabling External Commands
By default, Nagios does not check for or process any external commands. If you want to enable external command processing, you'll have to do the following...
Format: command_file=<file_name>
Example: command_file=/usr/local/nagios/var/rw/nagios.cmd
This is the file that Nagios will check for external commands to process. The command CGI writes commands to this file. Other third party programs can write to this file if proper file permissions have been granted as outline in here. The external command file is implemented as a named pipe (FIFO), which is created when Nagios starts and removed when it shuts down. If the file exists when Nagios starts, the Nagios process will terminate with an error message.
-Da die nagios.cmd eine Pipe ist, wird die Datei beim Starten von Nagios angelegt.
2. Enabling External Commands
By default, Nagios does not check for or process any external commands. If you want to enable external command processing, you'll have to do the following...
- Enable external command checking with the check_external_commands option [1]
- Set the frequency of command checks with the command_check_interval option [2]
- Specify the location of the command file with the command_file option ]siehe oben unter Punkt 1.]
- Setup proper permissions on the directory containing the external command file. Details on how to do this can be found [3]
- 0 = Don't check external commands (default)
- 1 = Check external commands
[1]
External Command Check Option
Format: check_external_commands=<0/1>
Example: check_external_commands=1
This option determines whether or not Nagios will check the command file for commands that should be executed. This option must be enabled if you plan on using the command CGI to issue commands via the web interface. Third party programs can also issue commands to Nagios by writing to the command file, provided proper rights to the file have been granted [...]
[2]External Command Check Interval
Format: command_check_interval=<xxx>[s]
Example: command_check_interval=1
If you specify a number with an "s" appended to it (i.e. 30s), this is the number of seconds to wait between external command checks. If you leave off the "s", this is the number of "time units" to wait between external command checks. Unless you've changed the interval_length value (as defined below) from the default value of 60, this number will mean minutes.
Note: By setting this value to -1, Nagios will check for external commands as often as possible. Each time Nagios checks for external commands it will read and process all commands present in the command file before continuing on with its other duties.
Als du nagios compiliert hast, hast du beim ./configure die Berechtigungen für diese Datei angegeben.
Ohne Optionen darf der User nagios und die Gruppe nagios in die Pipe scheiben.
Das heist das du Nagios beim compilieren gesagt hast mit welchen rechten die Datei angelegt werden soll.
Du solltest auch ueberpruefen als "wer" du dich an einer Webseite anmeldest sondern unter welchem Benutzer der Dienst läuft, der dir diese Webseite anzeigt
[3]
Users and Groups
First, find the user that your web server process is running as. On many systems this is the user nobody, although it will vary depending on what OS/distribution you are running. You'll also need to know what user Nagios is effectively running as - this is specified with the nagios_user variable in the main config file.
Next we're going to create a new group whose members include the user the web server is running as and the user Nagios is running as. Let's say we call this new group 'nagiocmd' (you can name it differently if you wish). On RedHat Linux you can use the following command to add a new group (other systems may differ):
/usr/sbin/groupadd nagiocmd
Next, add the web server user (nobody or apache, etc) and the Nagios user (nagios) to the newly created group with the following commands:
/usr/sbin/usermod -G nagiocmd nagios
/usr/sbin/usermod -G nagiocmd nobody
Setting directory permissions
Next, change the ownership of the directory that will be used to hold the command file...
chown nagios.nagiocmd /usr/local/nagios/var/rw
Make sure the Nagios user has full permissions on the directory...
chmod u+rwx /usr/local/nagios/var/rw
Make sure the group we created has full permissions on the directory.
chmod g+rwx /usr/local/nagios/var/rw
In order to force newly created files in the directory to inherit the group permissions from the directory, we need to enable the group sticky bit on the directory...
chmod g+s /usr/local/nagios/var/rw
If you supplied the --with-command-grp=somegroup option when running the configure script, you can create the directory to hold the command file and set the proper permissions automatically by running 'make install-commandmode'.
saludos
gnarff