Event Logs...

Does anyone know if there is a way to transfer the event logs into a log server?

Thanks in advance.

That would be cool, but I am not aware of that feature in Canopy’s OS. Sorry

I didn’t think so, but I wasn’t sure. Thank you anyway!

Betcha VJ can script it though!

lol… with perl anything is possible…

what log server are you using ?

Yes it is possible, I can develop the script to pull the event log from the devices but I need to know how I will need to interface to with the log server to insert the data into it…

give me more info and I will get it done for you… if you are using a monitoring tool that allows me to send alerts to it, i can look for errors and then send in a trap to your event mangement system if you want…

Hey Vj… Not to jump on some one else’s thread 8) but how about a script I could load on my server that would blanket reboot all sm units at the same time?

yes that is easy… we do it all the time… at night my scrip will go and log into all the SM make changes if need be and then reboot them…

like switch frequency… and reboot

Is that all you want it to do… log in and reboot… the script will need to be run on a linux machine… .it will be written in perl so it is portable on windows but I will develop and test on linux…

vj wrote:

what log server are you using ?

lol We haven't built it yet. My boss was just wondering if transferring the event logs could be done and I didn't have an answer so I came to you guys.

VJ, I'll give my boss a heads up on your offer. Thank you for your help! :D


here is version 1 of the script, fresh off our of the development house
cat | while read line
curl -s -u " :<password>" "http://$line/himom.cgi?Reboot=Reboot"

replace <password> with the full access password for the SM/AP/BH

you must have curl in on your machine and its location needs to in your PATH, it normally sits in /usr/bin most linux flavours have it as standard distribution if not you can download it, it is a single binary…

the above is a shell script, we don’t need perl… create a file called
put those 4 lines into it
chmod 755 reboot.sh
and then
<it will return a line asking for input at which stage you paste in a list of IP you want to reboot, one ip per line>

you don’t need to wait till it finishes with the first IP just load it up and it will work its way through it… if it can’t log in then after a while it will give up and then move to the next line…

it will not tell you if it failed although curl returns an error code to say it failed… if you need to know if it failed then let me know and I will put in another 2/3 lines of code for you…

let me know if you have any probs


cat | while read line
curl -s -u " :<password>" "http://$line/eventlog.html"

This will pull the event log page for and display it on the screen with all the HTML tags… if I know what you want to do with it we can strip the HTML and then start to format the log…

again create a file event.sh
put the above 4 lines into it
chmod 755 event.sh
and then ./even.sh

change the <password> to your own password for the device…

I have kept the scripts extremely basic so you can see the simplicity of them, but we normally put many error checks and intelligence into them so they can make decisions based on non expected results…

wow! thanks vj! You rock 8)

Holy crap it worked! :shock: I’m not surprised that the code you gave me was right, I’m just shocked I actually got it work.

Ok, ok, now that I’ve got all this html code how can I format it into a nice neat text file. Please be gentle. I’m a Linux virgin :? Although I am having fun playing with Freespire.

on unix if your script is called reboot.sh


reboot.sh > textfile

will dump the output into a text file, however you could send the output into awk a parsing utility that will allow you to select certain fields

reboot.sh | awk {....}

Tell me exactly what you want to extract from the event log and how you want it formatted

Tell me exactly what you want to extract from the event log and how you want it formatted

Well, I guess all of the text sans the HTML tags. I'm really only experimenting with this at the moment. The higher authorities are more or less afraid of Linux machines, but I figured it would be a good idea to learn some Linux stuff anyway. If I could get the Event logs formated in a text file that looks similiar to the way it appears in the Canopy unit, then I'll be happy. I know there isn't much point to doing that, but like I said this is merely a learning experience for me and at least it's a start. If you have some suggestions, please let me know. Thanks for your help already. :)