After searching this forum for a Windows uptime script I found this thread that gave me enough information to go on and build a script based on my needs. The solution from Thomas Rupp in message:http://forums.cacti.net/viewtopic.php?t=6998 did the trick.
Here is a preview of the graph that it produces:
1.- Download uptime.zip and save it to a local folder.
2.- Extract the file to a subdirectory \uptime.
3.- Copy its contents to, exept the two XML-files, to a new directory \uptime under the <path to cacti>\scripts drectory. The data-template assumes <path to cacti>\scripts\uptime.
4.- Go to this new dir. and edit win_uptime.cmd. Find the three set variables and change them to your needs.
Code: Select all
set htmlfile=d:\<path to cacti>\cacti\log\uptime_%1.html set htmladdr=http://www.your.domain/cacti/log/uptime_%1.html set script_path=d:\<path to cacti>\cacti\scripts\uptime\
6.- If you have placed the scripts and programmes in another place you have to edit the Data Input Methods [edit: Windows uptime].
Code: Select all
<path_cacti>/scripts/uptime/win_uptime.cmd <hostname> <sla_avail>
7.- After that you can create a new graph for your device. The hostname is already taken and you will be asked to give the required avalability. Default is 99.9900%.
8. Wait for two or three pollings and the results will show up.
1,- This script counts and evaluate the readings of eventnumber 6005 in the eventlog. If the eventlog is reset, the script starts at zero, but gives you the history.
2.- Maybe there is an easier way to collect the data, please feel free to alter and post your solution here.
3.- This is my first atempt to create a solution in this way. I hope it all works for you. Tested on cacti: 8.6.g.