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
bphinney
@bphinney
That was totally my bad, your stuff had nothing to do with it.
It was a customized option to try to enable data profiling and we probably shouldn't have tried to customize to that extent without documenting what we were doing.
Sander Botman
@sbotman
well you helpt me... These settings should not break the cookbook and I know a way how to fix it....
bphinney
@bphinney
Thanks again, really helped me out.
Sander Botman
@sbotman
:thumbsup:
created schubergphilis/nagios#459 for this..
Ken Schmidt
@Maigard
for #459 , you could do something like
def update_hash_options(hash)
  hash.each do |k, v|
    push(Nagios::CustomOption.new(k.upcase, v)) if k.start_with?('_') && self.respond_to?('push')
    m = k + '='
    send(m, v) if self.respond_to?(m)
  end
end
It would only add custom options for objects that accept them, and doesn't break on objects that don't have a push method.
bphinney
@bphinney
the cookbook is producing a hostgroups.cfg definition of . rather than . Anyone know what causes this?
Nevermind, I found it.
Ilja Krauchanka
@ikrauchanka
/code

pardon

define contact {
        contact_name                    bi-pagerduty
        alias                           BI PagerDuty Pseudo-Contact
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-pagerduty
        host_notification_commands      notify-host-by-pagerduty
        pager                           jew0efj0ejf01j0enjkqnjwnqdk
        }

How we can define contact without email?

Deepak Kosaraju
@kkdk5535
email is not mandatory object for contact definition as per nagios doc - https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectdefinitions.html#contact, so I think @sbotman would have made library accordingly
I am still understanding custom resource and defintions in this cookbook - I may be wrong about how it is instrumented in the cookbook
Sander Botman
@sbotman
Well, nagios doesn't start if contacts don't have any email, so that's why I skip them.
Will need to look at the doc's again to understand this better.. will see if I have some time for this tomorrow.
The definitions are pushing all the objects to the memory model: Nagios.instance If you debug the chef-run with pry require 'pry';binding.pry you should be able to look at all the objects within the memory when you dump Nagios.instance.contacts for example.
At the last part the templates are writing all the objects to disk by calling the definition method
Sander Botman
@sbotman
Thanks for the tip @Maigard, I was thinking to make a push method within the base which prints debug information like : pushing the #{key} into the object #{self.class} is not supported. Then it just skips them with some output why..
Objects that do support the push method will overwrite it with the proper code accordingly
Ken Schmidt
@Maigard
Yeah, I like that. If you are making the assumption that all inherited classes are going to have the function, you can just make the guarantee that it will be there that way. Plus, the conditional line is getting long, and you wouldn't want to tempt the rubocop. :smile:
Ilja Krauchanka
@ikrauchanka
Hello guys,I cannot get one thing - why service definition appears in templates.cfg and how to move it to right direction -> servvices.cfg.
Service definition I took from wiki.
- update content in file /etc/nagios/conf.d/templates.cfg from 63f798 to 8cba53
    --- /etc/nagios/conf.d/templates.cfg    2015-11-16 10:39:36.261057411 -0500
    +++ /tmp/chef-rendered-template20151116-26917-wtvl6i    2015-11-16 10:40:00.724595242 -0500
    @@ -516,5 +516,18 @@
       register                      0
     }

    +define service {
    +  name                    wefwefwef-service
    +  service_description     wefwefwef-service
    +  check_command           wefwefwef-service
    +  active_checks_enabled   1
    +  passive_checks_enabled  1
    +  obsess_over_service     1
    +  check_freshness         0
    +  event_handler_enabled   1
    +  notifications_enabled   1
    +  parallelize_check       1
    +  register                0
    +}
Deepak Kosaraju
@kkdk5535
@ikrauchanka This is not service defintion as you mentioned register as 0
normally u don’t specify register as 0 for service defintion in nagios, we only do that for templates in best world of nagios implementation
Sander Botman
@sbotman
Remove the name. When specifying name it will register as template.
Ilja Krauchanka
@ikrauchanka
@sbotman aha, so then we should remove 'name ' from https://github.com/schubergphilis/nagios/wiki/services.cfg ?
Sander Botman
@sbotman
done
Ilja Krauchanka
@ikrauchanka

Guys, another question, sorry if it is a stupid one.
I have nagios config file with about 100 definitions for services. It looks like:

define service{
        use                             fine-vone-service
        host_name                                    fine-services-web
    service_description             API authenticaion for 192.168.220.244
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           10
        retry_check_interval            2
        notification_interval           20
        notification_period             24x7
        check_command                   check_fine_login!192.168.220.244
        }
define service{
        use                             fiine-vone-service
        host_name                                    fine-services-web
        service_description             API authentication for 192.168.220.245
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           10
        retry_check_interval            2
        notification_interval           20
        notification_period             24x7
        check_command                   check_fine_login!192.168.220.245
        }

I've already prepared them for nagios_service definitions, by converting into hashes. From the link above, service should be defined like:

nagios_service 'default-service' do

What I should pass into nagios_service instead of 'default-service' ?
As you can see I do not have names in my current nagios configs.
Thanks!

Sander Botman
@sbotman
You pass the service_description
Ilja Krauchanka
@ikrauchanka
but descriptions is ugly, they are with '/' , ' ', and even may be with '%' and no guarantee that somebody in the future will not use these characters :(
actually I already did service_description with another two cfg files,but decided ask you about to find better way.
Ilja Krauchanka
@ikrauchanka
solved in im:
A:
Well.. calling nagios_service "bla" do within a recipe, sets bla as the service_description in the object..
Q:
can I call nagios_service without "bla" ?
A:
no... objects should have a name to store them in the model
Q:
and the name I should take from service_description from nagios configs?
A:
yes
Sander Botman
@sbotman
:thumbsup:
Sander Botman
@sbotman
@joshskains on what platform are you installing?
Ken Schmidt
@Maigard
@sbotman I am around, but I am at a conference this week, so my access is spotty.
Sander Botman
@sbotman
Oke, wanted to chat about the last branch...
Ken Schmidt
@Maigard
ok.
Sander Botman
@sbotman
I looked at it and did some testing... with the pop method, do you want to remove the 'item' at all?
Or was it used for the null option to clear-out settings....
Ken Schmidt
@Maigard
I was wondering about that. I left the item there with the ussumption that without a connection to something else, it wouldn't be rendered
Sander Botman
@sbotman
Well, I already added the delete method on the Nagios.instance in the past, but that didnt remove the relations that were made within the model, so deleting a host would not delete the host in the host-group what it was a member of.
Guess we need to have a chat about this to fully explorer all the problems...when are you available on stable internet connection and out of the conference?
Ken Schmidt
@Maigard
I was trying to think of a way to remove an item if it was no longer connected to something, but couldn't come up with a good way to do it. Then decided that if an object didn't make sense anymore, it would rely on your checks to not actually put it in the config.
I won't be back until Saturday.
Sander Botman
@sbotman
Well, I will have until saturday then to write-up some tests and explorer your code...
:)
Ken Schmidt
@Maigard
Ha, I guess so. :smile:
Sander Botman
@sbotman
I already created a new branch, with the same name and fixed the merge conflict and made some changes..
It based of your code, so merging this will also merge yours...