这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Conversation

@svagner
Copy link
Contributor

@svagner svagner commented Jan 15, 2020

Description

Nodes with no-checks flag are returning RuleCheck in /api/health as true

$ ./main -c node1/bosun.toml -n
2020/01/15 16:57:50 info: migrate.go:138: checking migrations
2020/01/15 16:57:50 info: search.go:208: Loading last datapoints from redis
2020/01/15 16:57:50 info: search.go:215: Done
2020/01/15 16:57:50 info: web.go:216: tsdb host: 127.0.0.1:4242
2020/01/15 16:57:50 info: web.go:220: bosun web listening http on: :8071
...
$ curl -s 127.0.0.1:8071/api/health | jq .RuleCheck
false
$ curl -XPOST 127.0.0.1:8071/api/reload -d '{ "Reload": true }'
"reloaded"
$ curl -s 127.0.0.1:8071/api/health | jq .RuleCheck            
true

If node has no-checks flags RuleCheck should be false all time

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Integration test

no-checks was set:

$ ./main -c node1/bosun.toml -n
2020/01/15 17:02:47 info: migrate.go:138: checking migrations
2020/01/15 17:02:47 info: search.go:208: Loading last datapoints from redis
2020/01/15 17:02:47 info: search.go:215: Done
2020/01/15 17:02:47 info: web.go:216: tsdb host: 127.0.0.1:4242
2020/01/15 17:02:47 info: web.go:220: bosun web listening http on: :8071
$ curl -s 127.0.0.1:8071/api/health | jq .RuleCheck
false
$ curl -XPOST 127.0.0.1:8071/api/reload -d '{ "Reload": true }'
"reloaded"
$ curl -s 127.0.0.1:8071/api/health | jq .RuleCheck            
false

no-checks is false:

$ ./main -c node1/bosun.toml   
2020/01/15 17:05:11 info: migrate.go:138: checking migrations
2020/01/15 17:05:11 info: search.go:208: Loading last datapoints from redis
2020/01/15 17:05:11 info: search.go:215: Done
2020/01/15 17:05:11 info: check.go:561: check alert bosun_uptime start with now set to 2020-01-15 16:05:11.481449306
2020/01/15 17:05:11 info: web.go:216: tsdb host: 127.0.0.1:4242
2020/01/15 17:05:11 info: web.go:220: bosun web listening http on: :8071
2020/01/15 17:05:11 info: check.go:609: check alert bosun_uptime done (3.135856ms): 1 crits, 0 warns, 0 unevaluated, 0 unknown
2020/01/15 17:05:11 info: alertRunner.go:105: runHistory on bosun_uptime took 23.743938ms
2020/01/15 17:05:11 error: notify.go:84: type: alert; name: default; transport: http_POST; dst: http://127.0.0.1:8000/; body: <html><head></head><body>&#39;&#39;</body></html>; error: Post http://127.0.0.1:8000/: dial tcp 127.0.0.1:8000: connect: connection refused
2020/01/15 17:05:19 info: alertRunner.go:86: Stopping alert routine for bosun_uptime
2020/01/15 17:05:19 info: main.go:255: schedule shutdown, loading new schedule
2020/01/15 17:05:19 info: main.go:268: config reload complete
2020/01/15 17:05:19 info: main.go:263: running new schedule
2020/01/15 17:05:19 info: check.go:561: check alert bosun_uptime start with now set to 2020-01-15 16:05:19.184973544
2020/01/15 17:05:19 info: check.go:609: check alert bosun_uptime done (642.76µs): 1 crits, 0 warns, 0 unevaluated, 0 unknown
2020/01/15 17:05:19 info: alertRunner.go:105: runHistory on bosun_uptime took 3.392522ms
...
$ curl -s 127.0.0.1:8071/api/health | jq .RuleCheck
true
$ curl -XPOST 127.0.0.1:8071/api/reload -d '{ "Reload": true }'
"reloaded"
$ curl -s 127.0.0.1:8071/api/health | jq .RuleCheck            
true

Checklist:

  • This contribution follows the project's code of conduct
  • This contribution follows the project's contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@stale
Copy link

stale bot commented Jan 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 9, 2021
@stale stale bot closed this Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant