FAQ
Hi,

I've got Centos 5 with ruby 1.8.7, mcollective 2.2.4 and nrpe plugin 3.0.2
installed from a fresh mirror of puppetlabs repo.

When I try to run nrpe command as:

mco nrpe some_command

or:

mco rpc nrpe runcommand command=some_command
I get:

status=wrong number of arguments (2 for 0)

for every command that is actually defined. I get an, expected,
"status=UNKNOWN No such command:" for ones that aren't.

I've added some poor man's debug to
/usr/libexec/mcollective/mcollective/agent/nrpe.rb, and here's what I get:

debug 2013/07/04 14:29:37: agents.rb:119:in `dispatch' Dispatching a
message to agent nrpe
debug 2013/07/04 14:29:37: pluginmanager.rb:88:in `[]' Returning new plugin
nrpe_agent with class MCollective::Agent::Nrpe
debug 2013/07/04 14:29:37: cache.rb:105:in `read' Cache hit on 'ddl' key
'agent/nrpe'
debug 2013/07/04 14:29:37: activemq.rb:233:in `receive' Waiting for a
message from ActiveMQ
debug 2013/07/04 14:29:37: nrpe.rb:41:in `run' HERE!!! in run
debug 2013/07/04 14:29:37: nrpe.rb:46:in `run' HERE!!! past
plugin_for_command
debug 2013/07/04 14:29:37: nrpe.rb:49:in `run' HERE!!! output empty:
debug 2013/07/04 14:29:37: nrpe.rb:50:in `run' HERE!!! trying to run
Shell.new with /usr/lib64/nagios/plugins/some_command
debug 2013/07/04 14:29:37: pluginmanager.rb:83:in `[]' Returning cached
plugin security_plugin with class MCollective::Security::Psk
debug 2013/07/04 14:29:37: pluginmanager.rb:83:in `[]' Returning cached
plugin security_plugin with class MCollective::Security::Psk
debug 2013/07/04 14:29:37: base.rb:168:in `create_reply' Encoded a message
for request 2e9521e4d6aa5b019791284dfa9cc22f
debug 2013/07/04 14:29:37: pluginmanager.rb:83:in `[]' Returning cached
plugin connector_plugin with class MCollective::Connector::Activemq

My "code" is as follows:
       def self.run(command)
         Log.debug("HERE!!! in run")
         nrpe_command = Nrpe.plugin_for_command(command)
         return 3, "No such command: #{command}" unless nrpe_command
         Log.debug("HERE!!! past plugin_for_command")
         output = ""
         Log.debug("HERE!!! output empty: #{output}")
         Log.debug("HERE!!! trying to run Shell.new with
#{nrpe_command[:cmd]}")
         shell = Shell.new(nrpe_command[:cmd], {:stdout => output, :chomp =>
true})
         Log.debug("HERE!!! past shell")
         shell.runcommand
         Log.debug("HERE!!! past shell.runcommand")
         exitcode = shell.status.exitstatus

         Log.debug("HERE!!! output: #{output}")
         return exitcode, output
       end

So it never goes to "past shell", let alone runcommand. The
/usr/lib64/nagios/plugins/some_command is there, is executable, works with
nagios currently without any issues.

If I take out ":chomp => true", which doesn't seem to be listed in
/usr/lib/ruby/site_ruby/1.8/mcollective/shell.rb, nothing changes, but if I
take the entire option hash out I get "wrong number of arguments (1 for 0)"
- so 1, not 2.

That's where I'm stuck. All the other plugins work fine (I mostly use the
puppet plugin, but others, like service, also work).

Any ideas?


Regards,
Daniel



--

---
You received this message because you are subscribed to the Google Groups "mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcollective-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
groupmcollective-users @
categoriespuppet
postedJul 4, '13 at 8:55p
activeJul 5, '13 at 1:58p
posts4
users2
websitepuppetlabs.com...

People

Translate

site design / logo © 2021 Grokbase