Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot execute commands, makes module unusable #8

Open
dgilm opened this issue Sep 19, 2014 · 6 comments
Open

Cannot execute commands, makes module unusable #8

dgilm opened this issue Sep 19, 2014 · 6 comments

Comments

@dgilm
Copy link
Contributor

dgilm commented Sep 19, 2014

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
Copy link
Contributor

I think you should define it in a command config file

@naparuba
Copy link
Member

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
#8 (comment)
.

@dgilm
Copy link
Contributor Author

dgilm commented Sep 19, 2014

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
Copy link
Contributor

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

@lostmimic
Copy link

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

@lostmimic
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants