Email alert text

Asked by Ed Grubb

I've just got my first email alert from a display which was purposfully turned off to test the alert system. The text of the email said "Display XXX with ID XX has recovered", but it hadn't recovered, it had been turned off. Is this right?

Question information

Language:
English Edit question
Status:
Solved
For:
Xibo Edit question
Assignee:
No assignee Edit question
Solved by:
Alex Harrington
Solved:
Last query:
Last reply:
Revision history for this message
Alex Harrington (alexharrington) said :
#1

Clearly it's not the right message, but it does at least prove that the script is running properly.

Firstly try changing MAINTENANCE_ALWAYS_ALERT to On in the settings and then manually run the script in a browser. Do you get an alert? What does the output from the script show?

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#2

MAINTENACE_ALWAYS_ALERT is already turned to On. When I run the maintenance.php scripted in a browser, under email alert I get "DDDD.DD.D....D."

Revision history for this message
Alex Harrington (alexharrington) said :
#3

> MAINTENACE_ALWAYS_ALERT is already turned to On. When I run the
> maintenance.php scripted in a browser, under email alert I get
> "DDDD.DD.D....D."

It's showing 8 displays that have alerts disabled in their individual
settings and 7 which have connected within their timeouts so aren't
alerting.

Have a look in Display Management and check the last connection time for
the client you're testing with, and also the timeout value you've set in
both Alert Timeout on the display record and MAINTENANCE_ALERT_TOUT in
the settings.

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#4

(I only have my active displays with email alert enabled. The others I can't delete from the displays list, so don't have alerts set.)

my MAINTENANCE_ALERT_TOUT is set to 20mins, each display is phoneing home every 5 mins when they are set to collect new content.

Revision history for this message
Alex Harrington (alexharrington) said :
#5

> my MAINTENANCE_ALERT_TOUT is set to 20mins, each display is phoneing
> home every 5 mins when they are set to collect new content.

OK - so how long ago did the test display last check in according to the
server?

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#6

6 minutes

Revision history for this message
Alex Harrington (alexharrington) said :
#7

> 6 minutes

So it won't alert until it's at least 20 minutes since it last
connected. You should then get a message telling you that it's gone
offline.

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#8

yeah, thats what it did, it was the fact that the text was wrong. I would have expected 2 emails, the first to so it had gone offline and the second to say it was back online.

Revision history for this message
Alex Harrington (alexharrington) said :
#9

With regards to disabling your old clients, the maintenance script will
only alert for licensed displays - so if you unlicense the displays
you're not using then you won't get alerts for them.

Alex

Revision history for this message
Alex Harrington (alexharrington) said :
#10

That's what it will do - or at least should do.

It has to change state though to trip the email so if it was already
offline when you enabled the alert then it won't tell you until after it
comes back online and then goes offline again.

Alex

Revision history for this message
Alex Harrington (alexharrington) said :
#11

I bet I know what's happening.

The alerting relies on the "loggedin" field in the database - which is
recalculated each time you refresh the Display Management page in the
server.

If you close your browser and then take the client offline I think
you'll get the message as expected.

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#12

Ok, thanks, I will give this a go and I'll let you know.

Revision history for this message
Ed Grubb (e-grubb) said :
#13

This worked, kind of. I've got the correct email when it was disconnected, but now I haven't got one when it was reconnected

Revision history for this message
Alex Harrington (alexharrington) said :
#14

Did you visit the Display Management page at all?

Revision history for this message
Ed Grubb (e-grubb) said :
#15

yes, I'm just trying it again without going back to the display management

Revision history for this message
Alex Harrington (alexharrington) said :
#16

That will be why then.

The alert is triggered when the maintenance script changes the logged in light from red to green or visa versa. If you visit display management and that page updates the status then the alert won't be triggered, except where it's a display going offline and ALWAYS_ALERT is On (as each run of the script generates an email).

I don't think that's a huge problem as personally I only ever visit display management if I'm adding or removing a display. I don't routinely sit refreshing the page!

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#17

Hmm, I tried it again, got the first email, closed the admin interface and didn't go back in, reconnected the client but haven't got a reconnected email. I know its not major, but it's nice to have it all working properly

Revision history for this message
Alex Harrington (alexharrington) said :
#18

Strange. I've tested it here this afternoon and it all worked fine.

I'll run another test and see if I can recreate it.

Alex

Revision history for this message
Best Alex Harrington (alexharrington) said :
#19

OK. What's happening is that I'm running code on my production box that isn't quite 1.2.0 release.

Testing on a 1.2.0 box I do get this problem. What's happened is we merged in some code that tracks the client's IP address and that code updates the loggedin lights each time the client connects - which then means that the maintenance script can't detect it coming back online.

I'll file a bug for it for now - but I'm not sure how/if we'll fix it.

Alex

Revision history for this message
Ed Grubb (e-grubb) said :
#20

Thanks Alex Harrington, that solved my question.