shinken-monitoring / mod-ws-arbiter

Shinken module for listening external commands from a web service
GNU Affero General Public License v3.0
3 stars 9 forks source link

Cannot execute commands, makes module unusable #8

Open dgilm opened 10 years ago

dgilm commented 10 years ago

I am not able to execute external commands with the ws-arbiter module.

I want to restart the arbiter with the following request:

curl -u shinken:shinken -d '' http://127.0.0.1:7760/restart

I get:

[1411113765] Warning : [WS_Arbiter] command: [1411113765] RESTART_PROGRAM
127.0.0.1 - - [19/Sep/2014 10:02:45] "POST /restart HTTP/1.1" 200 0
[1411113766] Info :    EXTERNAL COMMAND: [1411113765] RESTART_PROGRAM
[1411113766] Debug :   mode= dispatcher, global= True
[1411113766] Debug :   Got commands RESTART_PROGRAM []
[1411113766] Error :   Cannot restart Shinken : missing command named 'restart_shinken'. Please add one

With a reload command:

curl -u shinken:shinken -d '' http://127.0.0.1:7760/reload

I get pretty the same result:

[1411113771] Warning : [WS_Arbiter] command: [1411113771] RELOAD_CONFIG
127.0.0.1 - - [19/Sep/2014 10:02:51] "POST /reload HTTP/1.1" 200 0
[1411113771] Info :    EXTERNAL COMMAND: [1411113771] RELOAD_CONFIG
[1411113771] Debug :   Command 'RELOAD_CONFIG' is not recognized, sorry

Is there any config I am missing? Is this related to #1?

The versions that I am using: Shinken 2.0.3 and ws-arbiter module from master branch

Seb-Solon commented 10 years ago

I think you should define it in a command config file

naparuba commented 10 years ago

yes, it's in the default configuraiton since the 2.0, but we do not add it to updated 1.4 one as an update never change the user configuration :)

On Fri, Sep 19, 2014 at 2:04 PM, Sébastien Coavoux <notifications@github.com

wrote:

I think you should define it in a command config file

— Reply to this email directly or view it on GitHub https://github.com/shinken-monitoring/mod-ws-arbiter/issues/8#issuecomment-56168557 .

dgilm commented 10 years ago

You are right @Seb-Solon,

So, there's a misspelling in the commands/restart-shinken.cfg (or in external_command.py of the core repo)?

--- commands/restart-shinken.cfg.orig   2014-09-19 14:18:49.946241592 +0200
+++ commands/restart-shinken.cfg    2014-09-19 14:18:58.534241433 +0200
@@ -1,5 +1,5 @@
 define command {
-    command_name        restart-shinken
-    command_line        sudo /etc/init.d/shinken restart
+    command_name        restart_shinken
+    command_line        /etc/init.d/shinken restart
 }

/reload seems not to be managed by external_command.py.

Seb-Solon commented 10 years ago

We can ask @mohierf . He did the PR to add reload / restart feature :)

lostmimic commented 9 years ago

Did this ever get resolved, seeing the same issue :)

lostmimic commented 9 years ago

N/M, I see that the fix requires Shinken 2.2-RC1 :)