Computer Check-in via http
-
Greetings,
I was really hoping you could give me some advise on performing a "heartbeat" function on workstations. I have a solution on server that works but I really don't like it. I have an account with a monitoring company that provides a unique address to issue a http request to. If a request is not received once per hour it rings in as overdue. For servers I use a wget script under windows that looks like this:
"C:program files (x86)GNUWin32binwget.exe" http://0.0.0.0/m/0000-0aaa00/
Del "C:wget*.htm" /q
Del "C:wget*.html" /q
Using this method wget will download the page and reset the heartbeat and then delete the htm or html file that was downloaded. I have set it up as a scheduled task running every 20 minutes so the machine would have 3 chances to check in before the alarm would be sent. This works for me but there is a glaring problem: 1) Its Messy, 2) Its Visible to the user for a fraction of a second, 3) It takes time to setup, deploy and modify.
I have been searching the internet high and low for a program what will sit in the system tray and get a defined website on a schedule completely invisible to the user (except for the tray icon of course). However I can not find anything that will do this but I know it exists in other software as a check in method.
Do you have any ideas on how I can improve this? Do you know of a program free or paid that does this using the parameters I have provided?
Thanks in advance
-
I would say that it would be something you write yourself to do that. I am not a programmer but that seems simple enough you could learn the basics and do it. There may be a product that could make it into an executable windows binary also. Good luck!
-
I have used automation software to do this in the past which works great on servers, but would get incredibly expensive on clients. Paul's suggestion to develop something in-house is probably your best bet. There are code samples for this type of activity (example). If you don't have any programmers on hand, that can be an issue.
Another alternative would be to change the behavior of your existing script to match your needs. My first thought is that you could compile your BAT/CMD file to an EXE using a compiler like this one. Then, in the task scheduler you could call it like this:start "" "C:\Script Location\Script.exe"
Here's a few other things that could help.
-
Consider using cURL instead of WGET. cURL outputs to the buffer so you could execute this:
curl http://0.0.0.0/m/0000-0aaa00/ > nul
which would save you from having to write/delete files. You can find Windows binaries for cURL here.
2) You can use a text file to store the computer ID so that the batch file becomes generic. For example:
Create a file named C:\computerid.ini with the unique computer ID inside of it. For example:0000-0aaa00
Then, do this in your script:
@ECHO OFF SET /P COMPUTERID= < C:\computerid.ini curl http://0.0.0.0/m/%COMPUTERID%/ > nul
I know it isn't the perfect answer, but I hope that gets you in the right direction.
Don Pezet
Host, ITProTV -
-
Sorry, the website is clipping out some of my syntax, so the code sample above is not complete. I'll post an update as soon as I figure out how to override our security checks :)
-
There we go. My code samples are now correct.
-
What Don Said.
If writing BAT scripts get old try MJNET Macro Scheduler.
It is an awesome pseudo-code scripting language software designed for automation. The only thing that's better then that is their support forums.
Grab a trial version, write your little script, use built in EXE compiler and you're done.
If you like it spend $75 on it. -
I just noticed the new site layout messed up my code entries again. I'll have to fix it.