Skip to content

Example in check-http-json does not work. #115

@robertely

Description

@robertely

Trying this example:

#   Check that will verify http status, JSON validity, and that page.totalElements value is
#   greater than 10
#      ./check-http-json.rb -u http://my.site.com/metric.json --key page.totalElements --value-greater-than 10

I don't see where page.totalElements is setup. It does not exist in leaf so far as i see.

Command run:

/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/check-http-json.rb -u https://jsonplaceholder.typicode.com/todos/ --key page.totalElements --value-less-than 10

Returns:

CheckJson CRITICAL: key check failed: undefined method `to_f' for #<Array:0x000000013a9f70>
Did you mean?  to_s
               to_a
               to_h

Versions:

/opt/sensu/embedded/bin/ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
/opt/sensu/embedded/bin/gem list |grep 'sensu-plugins-http'
sensu-plugins-http (3.0.1)
/opt/sensu/embedded/bin/sensu-client --version
1.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions