Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 18 2017 22:37

    shoekstra on use_nginx

    (compare)

  • Sep 18 2017 22:37

    tas50 on master

    Depend on nginx instead of chef… Use nginx >= 7.0 Merge pull request #552 from so… (compare)

  • Sep 18 2017 22:37
    tas50 closed #552
  • Sep 18 2017 22:14
    shoekstra synchronize #552
  • Sep 18 2017 22:14

    shoekstra on use_nginx

    Use nginx >= 7.0 (compare)

  • Sep 18 2017 22:12
    shoekstra commented #551
  • Sep 18 2017 22:11
    shoekstra commented #552
  • Sep 18 2017 22:11
    shoekstra commented #552
  • Sep 18 2017 22:09
    shoekstra closed #546
  • Sep 18 2017 22:09
    shoekstra commented #546
  • Sep 18 2017 22:06
    shoekstra synchronize #552
  • Sep 18 2017 22:06

    shoekstra on use_nginx

    Depend on nginx instead of chef… (compare)

  • Sep 18 2017 22:03
    shoekstra review_requested #551
  • Sep 18 2017 22:01
    shoekstra synchronize #551
  • Sep 18 2017 22:01

    shoekstra on release_8.0.0

    Release 8.0.0 (compare)

  • Sep 18 2017 22:00
    shoekstra review_requested #552
  • Sep 18 2017 22:00
    shoekstra review_requested #552
  • Sep 18 2017 22:00
    shoekstra opened #552
  • Sep 18 2017 21:59

    shoekstra on use_nginx

    Depend on nginx instead of chef… (compare)

  • Sep 18 2017 21:57
    shoekstra review_requested #551
Sander Botman
@sbotman
data looks fine...
oke, other option..
bphinney
@bphinney
@sbotman yes, I am grinding through it but I don't see anything either
Sander Botman
@sbotman
just remove all the debug lines...
then edit the base.rb in libraries..

change the:

def update_hash_options(hash)
  hash.each do |k, v|
    push(Nagios::CustomOption.new(k.upcase, v)) if k.start_with?('_')
    if v.is_a? String
      @modifiers[k] = v[/^[+!]/]
      v = v.gsub(/^[+!]/, '')
    end
    m = k + '='
    send(m, v) if self.respond_to?(m)
  end
end

into:

def update_hash_options(hash)
  hash.each do |k, v|
    require 'pry'; binding.pry if k.start_with?('_')
    push(Nagios::CustomOption.new(k.upcase, v)) if k.start_with?('_')
    if v.is_a? String
      @modifiers[k] = v[/^[+!]/]
      v = v.gsub(/^[+!]/, '')
    end
    m = k + '='
    send(m, v) if self.respond_to?(m)
  end
end
Like that, just add the require 'pry' line
if you run now, you can check what k is... just type puts k
bphinney
@bphinney
Okay, my file is not the same as yours, but I think I take your meaning.
Ahah, _graphite_prefix
Sander Botman
@sbotman
:)
so that must come from some other databag?
because I don't see it in your email..
bphinney
@bphinney
yes, one of my guys added in graphite for performance tracking
Sander Botman
@sbotman
but this should work ..
setting a custom attribute like _blabla_prefix...
still don't understand why it fails..
well.... it seems that it is trying to push the option on the command...
but commands don't hold custom options.. only services do as far as I understand..
but I think I can solve this...
did you found were the option was set?
would like to reproduce the problem within my test-kitchen..
bphinney
@bphinney
No
I don't see where that specific data is set other than when I am running the breakout test.
Sander Botman
@sbotman
Hmmm...
edit your nagios hosts
Euuuhh
graphite hosts
do you have a attribute node['nagios']['_graphite_prefix'] on them?
that's the only place I can think of since you have scanned all the databags...
bphinney
@bphinney
the role had a ['nagios']['graphite_prefix'] attribute set.
The actual node only had a ['graphite']['listen_port'] attribute
Sander Botman
@sbotman
oke..
bphinney
@bphinney
I don't see any _graphite_prefix attribute. Might be getting set by a recipe.
Is my thought.
Sander Botman
@sbotman
possible...
knife node edit NODE -a
then you see all attributes..
and I was saying it wrong, custom attributes can live on hosts, contacts and services if I read: https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/customobjectvars.html
this is what I tried to implement...
but I still don't understand why in your case it gives the error: undefined method `push' for #<Nagios::Command:0x000000106bc870>
Sander Botman
@sbotman
can you check one more thing for me....
once you are in the debug console, type: puts self.class
bphinney
@bphinney
Nagios::Command
Sander Botman
@sbotman
right..

so if we change this:

def update_hash_options(hash)
  hash.each do |k, v|
    push(Nagios::CustomOption.new(k.upcase, v)) if k.start_with?('_')
    m = k + '='
    send(m, v) if self.respond_to?(m)
  end
end

into this:

def update_hash_options(hash)
  hash.each do |k, v|
    if self.is_a?(Nagios::Service) || self.is_a?(Nagios::Contact) || self.is_a?(Nagios::Host)
      push(Nagios::CustomOption.new(k.upcase, v)) if k.start_with?('_')
    end
    m = k + '='
    send(m, v) if self.respond_to?(m)
  end
end
Sander Botman
@sbotman
this should remove your problem...
just don't know if it's the right solution...
bphinney
@bphinney
No, I just found the culprit
{
2 "id": "mem",
3 "hostgroup_name": "linux",
4 "command_line": "/usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_mem -t 20",
5 "_graphiteprefix": "qa.metrics.mem"
6 }
I want to thank you for all the help, it was really above and beyond.