Forum

Delete webser is not working

niko2
3 June 2010, 20:33
When I try deleting a webserver, I got an error message: Webserver is in use.
How can I delete it ? (Apart from deleting directly in mysql database ?)

Hiawatha version: 7.2
Monitor version : 0.2
Operating System: Debian 5.0
Hugo Leisink
3 June 2010, 21:42
With the current version of the Monitor, it can't be done. You have to delete it in the MySQL database. I will make it available in the next version of the Monitor.
niko2
7 June 2010, 14:36
do you have a script that do the job ? Just to be sure to delete all entries concerning the webserver, since I don't know the database schema
Hugo Leisink
7 June 2010, 14:43
If you edit the file "model/admin/webserver.php", remove the delete_oke() function and add the following function, it should work.
public function delete_item($item_id) {
$queries = array(
array("delete from actions where webserver_id=%d", $item_id),
array("delete from host_statistics where webserver_id=%d", $item_id),
array("delete from requests where webserver_id=%d", $item_id),
array("delete from server_statistics where webserver_id=%d", $item_id),
array("delete from webservers where id=%d", $item_id));

return $this->db->transaction($queries);
}
niko2
7 June 2010, 14:56
Ok, thank you
I will wait for the next release, and I delete manually for the moment :p
Hugo Leisink
7 June 2010, 14:58
The next version will be released soon.
This topic has been closed.