amonapp / amon

Amon is a modern server monitoring platform.
https://docs.amon.cx
GNU Affero General Public License v3.0
1.33k stars 108 forks source link

Tags not working properly #179

Open djsakisd opened 7 years ago

djsakisd commented 7 years ago

@martinrusev Hi Martin

I noticed an issue with Tags to see it try this simple test :

1)add 4 tag categories first - (ex. tagcat1.. tagcat4) 2)add 4 tags to these categories (ex. add tag1 -> tagcat1, tag2 -> tagcat2 etc) 3) add only one tag per host (ex. add tag4 ->server4, tag3->server3 etc) 4) now try filtering by tag on dashboard

If you filter by tag4 you will see only host4 - so correct here, BUT if you try filter by tag1 you will see host 1, host2, host3, and host4.


Also if you ADD a new tag on tags page and NOT apply a category to it then you will get an error in amon.log and all tags from tag page will disappear.

Quick FIX : If you go to mongodb amon database and delete the tag without category then all tags will restore to tags page without of courser the uncategorised deleted from amon mongodb.

martinrusev commented 7 years ago

@djsakisd The error on the tag page has been fixed. For the other one have to spend more time on it. For the error, if you don't want to update your whole Amon installation.

In /opt/amon/amon/api/views/tags.py, line 27: https://github.com/amonapp/amon/commit/8590325ca91541c2ac766a0567687a1568f79141#diff-5d41b98edab11ce21572839350714208

djsakisd commented 6 years ago

@martinrusev yes it's fixed now i can confirm. If i add tags without adding them to a category it works fine now - tags don't disappear anymore.

Regarding the other issue on server list & hosts maps per tag i've done some testing and found that this occurs only in server listing /per tag , hosts map /per tag and also in alert's page - alerts /per tag. In these pages filtering per tag is messed up.. ...BUT... in dashboard page if you make a dashboard and add a metric -> server all -> per tag based, then tags works fine and you see the metrics for the specific servers that has this tag.

I hope this helps you narrow down the issue.

I've had a look on your code but it's way out of my python knowledge so unfortunately i can't help any further.