Keeping track of current client IP for VNC monitoring

A client has 100s of hotdesking agents who they want to keep an eye on. Got tightVNC installed which has a web VNC port on port 5800. It is obviously tricky updating the IP address on each new machine they log into. So this trigger does it for you.

Thanks to Felim Whiteley for contribuiting.

Prerequisites

  • VNC server on port 5800

Required steps

Add the following trigger to the database:

DELIMITER //
DROP TRIGGER IF EXISTS vnc_url_update //
CREATE TRIGGER vnc_url_update AFTER INSERT ON arch_syslog
FOR EACH ROW BEGIN
IF (NEW.action = 1001 AND NEW.text1 LIKE "agent/%") THEN
UPDATE agenti_noti SET vnc_url = CONCAT("http://", NEW.text2, ":5800")
WHERE NEW.text1 = agenti_noti.nome_agente;
ELSEIF (NEW.action = 1002 AND NEW.text1 LIKE "agent/%") THEN
UPDATE agenti_noti SET vnc_url = ""
WHERE NEW.text1 = agenti_noti.nome_agente;
END IF;
END;//
DELIMITER ;

It will track agent log-ins and update the VNC URL automatically.