Page 1 of 1

New alert not showing up

Posted: Mon Oct 10, 2016 10:35 am
by BanditBBS
I have a user that created an alert and gets this:
created.png
But when he clicks alerts he sees this:
alerts.png

Re: New alert not showing up

Posted: Mon Oct 10, 2016 10:52 am
by mcapra
I'll see if I can replicate this. Do you know if the query user is using for the alert is globally accessible? From the "Manage Queries" button on any given dashboard (the little magnifying glass) you will see tiny little globes for all global queries like so:
2016_10_10_10_51_22_Dashboard_Nagios_Log_Server.png

Re: New alert not showing up

Posted: Mon Oct 10, 2016 11:06 am
by BanditBBS
His dashboard was not saved global.

Re: New alert not showing up

Posted: Mon Oct 10, 2016 1:32 pm
by mcapra
What is the access level of this user? Can you share a screenshot of their configuration page like so:
2016_10_10_13_32_14_Edit_User_Nagios_Log_Server.png

Re: New alert not showing up

Posted: Mon Oct 10, 2016 1:45 pm
by BanditBBS
Capture.PNG

Re: New alert not showing up

Posted: Mon Oct 10, 2016 2:11 pm
by mcapra
Those with a "User" level of access are unable to create alerts. This is described on the "User Management" page:
Limited Full Access. Users can see everything except the configuration options. However, they can not edit anything except their own profile's password, contact info, and api key.
However, it's not described very well on the "Alerting" page. I've filed a bug report for this issue (ID 9726) since there's a few considerations leading to this confusion. One of those considerations is that the back-end API returns a HTTP status code of 200 even if the user's insertion of an alert fails, which is why your user is seeing the "success" message box despite the actual failure.

Re: New alert not showing up

Posted: Mon Oct 10, 2016 2:32 pm
by BanditBBS
Alerts
Manage the local alerts for your Log Server. You can change alerting methods by editing the alert. If you're an admin, you can see everyone's alerts here.
What about that quote? If not an admin you can then only see alerts set to be sent to you? Is that what it means?

And yeah, if only admins can create alerts, that success message needs changed, or even the option to try and create an alert just needs removed if not an admin!

Re: New alert not showing up

Posted: Mon Oct 10, 2016 2:50 pm
by mcapra
BanditBBS wrote:What about that quote? If not an admin you can then only see alerts set to be sent to you? Is that what it means?
No. This language is intended to convey that user's who create alerts (with only "User" level privileges) can only see the alerts they've created. This is also reflected on the back-end of that page. The whole thing falls apart with the bug that prevents those with "User" privileges from creating any alerts, though. The logic on the back-end looks at who created the alert when determining if they should see it, not if they are receiving notifications for a specific alert. Unless they have "Admin" privileges in which case they see all alerts.

If I myself go into the source of the back-end API and alter the create alerts method to work for those with "User" privileges, everything on the Alerts page works appropriately.

View from user "bob" who created an alert (with "User" privileges):
2016_10_10_14_44_07_Alerting_Nagios_Log_Server.png
View from user "alice" who created an alert (with "User" privileges):
2016_10_10_14_45_04_Alerting_Nagios_Log_Server.png
View from the nagiosadmin user (with "Admin" privileges):
2016_10_10_14_45_47_Alerting_Nagios_Log_Server.png
I would offer a hot-patch since the fix is fairly elementary, but the file is unfortunately protected by SourceGuardian. The language on the "Users Management" page should also, in my opinion, be changed to reflect that users with the "User" privileges can create queries/alerts.