fixnodecomputer
March 26th, 2011, 06:39 AM
Hello
I'm new to linux (specifically to ubuntu server edition 10.10) so excuse me for my lack of knowledge in linux scripting language. Anyhow, I work for a company that does remote computer support, we use vnc protocol to help our clients. I installed a VNC repeater that allows my clients to connect to me going through all firewalls and port forwarding. The linux VNC repeater outputs all connection information to /var/log/vnc.log and looks something like
UltraVnc Linux Repeater version 0.14
UltraVnc Tue Mar 22 03:37:02 2011 > routeConnections(): starting select() loop, terminate with ctrl+c
UltraVnc Tue Mar 22 03:37:12 2011 > acceptConnection(): connection accepted ok from ip: 55.555.555.55
UltraVnc Tue Mar 22 03:37:25 2011 > acceptConnection(): connection accepted ok from ip: 55.555.555.55
UltraVnc Tue Mar 22 03:37:28 2011 > cleanUpAfterRepeaterProcExit(): closing connection (server=5, viewer=6)^C
UltraVnc Tue Mar 22 03:37:36 2011 > main(): relaying done
I need the script to check if it sent the last notice, if it did do not send again. The logic behind is if that line exists and has not been already sent then do mail -s, otherwise ignore and do not send.
I got this code from users help in another forum, I was hoping someone could help me add on and elaborate onto it.
#!/bin/bash
while [ 1 = 1 ]
do
grep -e "acceptConnection():" /var/log/vnc.log | tail -1 | mail -s "subject" email@email.com
done
can anyone help a NOOB out! ANY HELP is GREAT!!
Thanks,
Phillip K
P.S. tried to configure logcheck and similar tools with no success I just need a "Quick and dirty way" as another user mentioned
I'm new to linux (specifically to ubuntu server edition 10.10) so excuse me for my lack of knowledge in linux scripting language. Anyhow, I work for a company that does remote computer support, we use vnc protocol to help our clients. I installed a VNC repeater that allows my clients to connect to me going through all firewalls and port forwarding. The linux VNC repeater outputs all connection information to /var/log/vnc.log and looks something like
UltraVnc Linux Repeater version 0.14
UltraVnc Tue Mar 22 03:37:02 2011 > routeConnections(): starting select() loop, terminate with ctrl+c
UltraVnc Tue Mar 22 03:37:12 2011 > acceptConnection(): connection accepted ok from ip: 55.555.555.55
UltraVnc Tue Mar 22 03:37:25 2011 > acceptConnection(): connection accepted ok from ip: 55.555.555.55
UltraVnc Tue Mar 22 03:37:28 2011 > cleanUpAfterRepeaterProcExit(): closing connection (server=5, viewer=6)^C
UltraVnc Tue Mar 22 03:37:36 2011 > main(): relaying done
I need the script to check if it sent the last notice, if it did do not send again. The logic behind is if that line exists and has not been already sent then do mail -s, otherwise ignore and do not send.
I got this code from users help in another forum, I was hoping someone could help me add on and elaborate onto it.
#!/bin/bash
while [ 1 = 1 ]
do
grep -e "acceptConnection():" /var/log/vnc.log | tail -1 | mail -s "subject" email@email.com
done
can anyone help a NOOB out! ANY HELP is GREAT!!
Thanks,
Phillip K
P.S. tried to configure logcheck and similar tools with no success I just need a "Quick and dirty way" as another user mentioned