Forum

Hiawatha Monitor - SQL error

Fred
31 March 2015, 12:46
Hello,

I get the following error when login to Hiawatha Monitor web interface
SQL query: select h.id, sum(result_not_found) as count, h.hostname as label from host_statistics s, hostnames h, webserver_user a where s.hostname_id=h.id and s.webserver_id=a.webserver_id and a.user_id=1 and s.timestamp_begin>'2015-03-31 00:00:00' and result_not_found>0 and h.visible=1 group by hostname order by count desc


I have nothing in my mysql-error.log but I have the following in my mysql-slow.log
# User@Host: hiawatha[hiawatha] @  [192.168.1.165]  Id:   173
# Query_time: 0.000659 Lock_time: 0.000084 Rows_sent: 0 Rows_examined: 0
SET timestamp=1427798271;
select sum(bans) as count, h.hostname as label from host_statistics s, hostnames h, webserver_user a where s.hostname_id=h.id and s.webserver_id=a.webserver_id and a.user_id=1 and s.timestamp_begin>'2015-03-31 00:00:00' and bans>0 and h.visible=1 group by hostname order by count desc;
# Time: 150331 11:38:43


Could you please advise ?

Thank you

Hiawatha version: v9.8
Operating System: FreeBSD 10
Hugo Leisink
31 March 2015, 13:19
Strange, that query works fine for me. What MySQL version do you use?
Fred
31 March 2015, 13:45
Hi Hugo,
this is the result of mysql --version
mysql  Ver 14.14 Distrib 5.6.21, for FreeBSD10.0 (amd64) using  5.2
Hugo Leisink
31 March 2015, 15:35
I have no idea why it goes wrong in v5.6 (I'm using v5.5). How good is your SQL knowledge? Is it possible you try to make the query work?
Fred
1 April 2015, 12:19
My SQL knowledge is really limited..
Are you asking me to run the following from command line?
select sum(bans) as count, h.hostname as label from host_statistics s, hostnames h, webserver_user a where s.hostname_id=h.id and s.webserver_id=a.webserver_id and a.user_id=1 and s.timestamp_begin>'2015-03-31 00:00:00' and bans>0 and h.visible=1 group by hostname order by count desc;
Hugo Leisink
1 April 2015, 12:55
No, SQL can't be run from the command line. The query is located at the bottom of models/dashboard.php. Do you know anybody with SQL knowledge that could help you with this? Because the only way for me to help you with this is by having access to your server and do some debugging there.
Fred
1 April 2015, 13:20
Hi Hugo,

I'll be happy to provide access if this is an option an its not too much for you

I haven't really got anyone how could help me with sql.
Hugo Leisink
1 April 2015, 13:44
Sure, send me a password or SSH key and I'll take a look.
Fred
13 April 2015, 15:58
Hi Hugo,

I just emailed you all the login details that you will need.
I hope this will be enough to get you started

Thank you very much for your help
Fred
15 April 2015, 13:28
Hugo,

You are a start.
Thank you for going the extra mile to help me
Hugo Leisink
15 April 2015, 13:29
You're welcome. Please, let me know what you think of the Monitor after you've used it for a while.
This topic has been closed.