sensu / uchiwa

Uchiwa is a simple yet effective open-source dashboard for the Sensu monitoring framework.
https://uchiwa.io
MIT License
920 stars 174 forks source link

aggregate page empty? #313

Closed damm closed 9 years ago

damm commented 9 years ago

Hi,

I have several checks enabled as aggregates and it does not appear that I get any listed when I go to the page.

Thanks

screen shot 2015-04-23 at 6 10 33 pm screen shot 2015-04-23 at 6 10 15 pm

palourde commented 9 years ago

Hi @damm

If you hit the Sensu API aggregates endpoint directly, do you have any result?

Thanks!

damm commented 9 years ago

@palourde Yes I do.

I have roughly 5 checks that are aggregates (like check-disk).

P.S. Sorry for the late response Github didn't notify me.

[{"check":"check-cpu","issued":[1430982254,1430982249,1430982242,1430982241,1430982240,1430982231,1430982228,1430982224,1430982219,1430982212,1430982211,1430982210,1430982201,1430982198,1430982194,1430982189,1430982182,1430982181,1430982180,1430982171,1430982168,1430982164,1430982159,1430982152]},{"check":"check-resque-mubi","issued":[1430982252,1430982236,1430982222,1430982206,1430982192,1430982176,1430982162,1430982146,1430982132,1430982116,1430982102,1430982086,1430982072,1430982056,1430982042,1430982026,1430982012,1430981996,1430981982,1430981966,1430981952]},{"check":"check-resque-accounting","issued":[1430982245,1430982244,1430982215,1430982214,1430982185,1430982184,1430982155,1430982154,1430982125,1430982124,1430982095,1430982094,1430982065,1430982064,1430982035,1430982034,1430982005,1430982004,1430981975,1430981974,1430981945,1430981944]},{"check":"check_load","issued":[1430982255,1430982249,1430982248,1430982246,1430982242,1430982239,1430982238,1430982236,1430982232,1430982231,1430982228,1430982225,1430982219,1430982218,1430982216,1430982212,1430982209,1430982208,1430982206,1430982202,1430982201,1430982198,1430982195,1430982189,1430982188]},{"check":"check-ntp","issued":[1430982251,1430982242,1430982241,1430982239,1430982238,1430982233,1430982221,1430982212,1430982211,1430982209,1430982208,1430982203,1430982191,1430982182,1430982181,1430982179,1430982178,1430982173,1430982161,1430982152,1430982151,1430982149]},{"check":"check_disk","issued":[1430982256,1430982247,1430982246,1430982242,1430982239,1430982235,1430982226,1430982217,1430982216,1430982212,1430982209,1430982205,1430982196,1430982187,1430982186,1430982182,1430982179,1430982175,1430982166,1430982157,1430982156,1430982152,1430982149,1430982145]}]
palourde commented 9 years ago

Hi,

Did you just upgraded Uchiwa? If so, make sure to restart the Uchiwa service and clear your browser cache.

Also, could you fire up your browser console and see if you have any logs? You could also verify the log files.

Thanks

damm commented 9 years ago

@palourde yep I upgraded from 0.4.? to 0.7.1

Nothing in the js console except 'Navigated to', the logs don't have anything to mention about aggregates.

palourde commented 9 years ago

@damm If you manually retrieve the content from Uchiwa backend, do you see anything related to aggregates? (you might have to disable authentication).

Aggregates were added with 0.5.0 so you have to make sure that the Uchiwa process was restarted after the upgrade.

damm commented 9 years ago

Authentication is actually disabled as I use bitly's Google Authentication. I do see checks that list aggregates enabled; but I really don't see any aggregates. Do you want me to randomize the data and post it here?

palourde commented 9 years ago

Yes it would be great if you could provide an example of the data you see.

Also, did you installed Uchiwa from the source or the packages? In the former case, it might be related to the dependencies not properly updated.

damm commented 9 years ago
{"Checks":[{"command":"/etc/sensu/plugins/check-fs-writable.rb -d /tmp","dc":"nil","handlers":["default","slack"],"interval":900,"name":"check-fs-writable","standalone":true,"type":"status"},{"command":"/etc/sensu/plugins/disk-capacity-metrics.rb --scheme system.sensu.df","dc":"nil","handlers":["graphite"],"interval":60,"name":"disk-capacity-metrics","standalone":true,"type":"metric"},{"command":"/etc/sensu/plugins/check-memory-pcnt.sh -w 500 -c 250","dc":"nil","handlers":["default","slack"],"interval":30,"name":"check_memory-pcnt","standalone":true,"type":"status"},{"aggregate":true,"command":"check-ntp.rb -w 60 -c 120","dc":"nil","handlers":["default","slack"],"interval":30,"name":"check-ntp","standalone":true,"type":"status"},{"aggregate":true,"command":"/etc/sensu/plugins/check-load.rb -c 1,1,1 -c 2,2,2","dc":"nil","handlers":["default","slack"],"interval":30,"name":"check_load","standalone":true,"type":"status"},{"aggregate":true,"command":"check-disk.rb -c 95% -w 85%","dc":"nil","handlers":["default","slack"],"interval":30,"name":"check_disk","standalone":true,"type":"status"},{"command":"/etc/sensu/plugins/iostat-extended-metrics.rb --scheme system.sensu.iostat","dc":"nil","handlers":["graphite"],"interval":60,"name":"iostat-extended-metrics","standalone":true,"type":"metric"}],"Clients":[{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508295e+09,"version":"0.16.0"},{"acknowledged":false,"address":"54.174.236.252","dc":"nil","name":"influxdb","status":0,"subscriptions":["all"],"timestamp":1.432508304e+09,"version":"0.17.2"},{"acknowledged":false,"address":"54.174.216.6","dc":"nil","name":"sensu","status":0,"subscriptions":["all"],"timestamp":1.432508295e+09,"version":"0.17.2"},{"acknowledged":false,"address":"23.20.178.5","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508305e+09,"version":"0.16.0"},{"acknowledged":false,"address":"54.89.127.204","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508299e+09,"version":"0.16.0"},{"acknowledged":false,"address":"5.10.122.212","dc":"nil","name":"nil","output":"CheckDisk WARNING: /disk1 88%\n","status":1,"subscriptions":["all"],"timestamp":1.432508292e+09,"version":"0.17.2"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.43250829e+09,"version":"0.17.2"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508303e+09,"version":"0.16.0"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508289e+09,"version":"0.17.2"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","output":"CheckDisk WARNING: /disk1 91%\n","status":1,"subscriptions":["dc","origin","all"],"timestamp":1.432508309e+09,"version":"0.17.2"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","output":"CheckDisk WARNING: /disk1 92%\n","status":1,"subscriptions":["all"],"timestamp":1.432508292e+09,"version":"0.17.2"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508289e+09,"version":"0.17.2"},{"acknowledged":true,"address":"nil","dc":"nil","name":"nil","resque":{"db":2,"host":"redis_instance","port":6379,"thresholds":{"critical":20,"warning":10}},"status":0,"subscriptions":["all"],"timestamp":1.432508294e+09,"version":"0.17.2"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508295e+09,"version":"0.16.0"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","status":0,"subscriptions":["all"],"timestamp":1.432508304e+09,"version":"0.16.0"},{"acknowledged":false,"address":"nil","dc":"nil","name":"nil","resque":{"db":2,"host":"redis_instance","port":6379,"thresholds":{"critical":20,"warning":10}},"status":0,"subscriptions":["all"],"timestamp":1.432508299e+09,"version":"0.16.0"}],"Dc":[{"checks":"7","clients":"16","events":"3","name":"nil","redis":"true","stashes":"5","transport":"true","version":"0.17.2"}],"Events":[{"acknowledged":true,"action":"create","check":{"aggregate":true,"command":"check-disk.rb -c 95% -w 85%","duration":0.104,"executed":1.432508294e+09,"handlers":["default","slack"],"history":["1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],"interval":30,"issued":1.432508294e+09,"name":"check_disk","output":"CheckDisk WARNING: /disk1 88%\n","standalone":true,"status":1,"total_state_change":0,"type":"status"},"client":{"address":"nil","name":"nil","subscriptions":["all"],"timestamp":1.432508292e+09,"version":"0.17.2"},"dc":"nil","id":"c73ca72c-283a-4178-ab7e-4888d838af22","occurrences":8486},{"acknowledged":true,"action":"create","check":{"aggregate":true,"command":"check-disk.rb -c 95% -w 85%","duration":0.099,"executed":1.432508294e+09,"handlers":["default","slack"],"history":["1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],"interval":30,"issued":1.432508294e+09,"name":"check_disk","output":"CheckDisk WARNING: /disk1 91%\n","standalone":true,"status":1,"total_state_change":0,"type":"status"},"client":{"address":"nil","name":"nil","subscriptions":["dc","origin","all"],"timestamp":1.432508289e+09,"version":"0.17.2"},"dc":"nil","id":"ac0183c4-cc6a-44a1-a71a-53ff40ac2fd7","occurrences":10123},{"acknowledged":true,"action":"create","check":{"aggregate":true,"command":"check-disk.rb -c 95% -w 85%","duration":0.141,"executed":1.432508284e+09,"handlers":["default","slack"],"history":["1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1","1"],"interval":30,"issued":1.432508284e+09,"name":"check_disk","output":"CheckDisk WARNING: /disk1 92%\n","standalone":true,"status":1,"total_state_change":0,"type":"status"},"client":{"address":"nil","name":"nil","subscriptions":["all"],"timestamp":1.432508272e+09,"version":"0.17.2"},"dc":"nil","id":"8af8d11e-f27e-45d9-bb59-634800e38a5d","occurrences":10130}],"Stashes":[{"content":{"reason":"","source":"uchiwa","timestamp":1.429836762e+09},"dc":"nil","expire":-1,"path":"silence/staging_solo"},{"content":{"reason":"","source":"uchiwa","timestamp":1.432339503e+09},"dc":"nil","expire":-1,"path":"silence/england-origin/check_disk"},{"content":{"reason":"","source":"uchiwa","timestamp":1.432339491e+09},"dc":"nil","expire":-1,"path":"silence/california-origin/check_disk"},{"content":{"reason":"","source":"uchiwa","timestamp":1.429847774e+09},"dc":"nil","expire":-1,"path":"silence/testing_solo"},{"content":{"reason":"","source":"uchiwa","timestamp":1.43233951e+09},"dc":"nil","expire":-1,"path":"silence/dc-origin/check_disk"}],"Subscriptions":["all","dc","origin"]}
damm commented 9 years ago

It was installed via your package using the uchiwa cookbook (via chef)

palourde commented 9 years ago

@damm

Could you edit the following line in order to add logger.Info(aggregates) right after, so it looks like:

aggregates, err := api.GetAggregates()
logger.Info(aggregates)
if err != nil {
    Health.Sensu[api.Name] = map[string]string{"output": errorString}
    logger.Warning(err)
    continue
}

Restart Uchiwa and watch your logs, it should output an array of objects or something similar which is basically the response of the Sensu API.

Thanks

damm commented 9 years ago

@palourde well that appears to make my aggregates page load; I'm not sure why? there was nothing in the log file.

nothing in uchiwa.err, just the latest version from git

mkdir /root/go
export GOPATH="/root/go"
go fetch -v github.com/sensu/uchiwa

Changed the line like you mentioned and then ran go build .. replaced binary and it works, so fixed in master?

palourde commented 9 years ago

@damm I'm not aware of any issue with aggregates on the version 0.7.1 but I suppose the latest changes could have fixed this bug. I'm glad that you were able to fix it with the latest version. Let me know if there's anything else!