I’m looking for way to monitor robocopy job results running as a task on windows server and just wander if somebody could advise me something.
Ad Widget
Collapse
Monitoring robocopy job
Collapse
X
-
If it starts in cmd batch file, you can add the following in top of your cmd-batch:Code:@echo off set "logfile=[COLOR="blue"][I]<path_to_log_file>[/I][/COLOR]" [COLOR="blue"][I]rem This will restart batch itself with redirected STDIN and STDERR to log file.[/I][/COLOR] if NOT "%1" == "restarted" ( cmd /C "%~f0" restarted > "%logfile%" 2>&1 ) [I][COLOR="blue"]<your instructions here>[/COLOR][/I]
-
Smersh,
Thank you fro your reply.
Unfortunately I'm not as experienced as you so not quite sure what I should do with the code. I've added it to begin of coping script but it looks nothing happen so:
logfile=<path_to_log_file> - is it path for zabbix agent log folder?
How to create trigger for this?
Could you give me more details how it works and how to log success or failure?Comment
-
Scheduler job has exit code 0 if successful and other (or only 1?) if not. If it only what you want to monitor then you can use item like this:In the above code, color marked path to job in Microsoft Task Sheduler (windows 7/2008 and possible above). The highest is "\". Next comes "\Microsoft\", etc. Text of the event getting by above item is similar to: Task Scheduler successfully completed task "\name_of_job" , instance "{some_CLSID_here}" , action "C:\Windows\system32\Robocopy.exe" with return code 1.Code:eventlog[Microsoft-Windows-TaskScheduler/Operational,[B][COLOR="blue"]\"\\name_of_job\"[/COLOR][/B],,TaskScheduler,^201$,,skip]
For monitoring, you can use trigger like this:that mean not with return code 0.Code:{hostname:eventlog[Microsoft-Windows-TaskScheduler/Operational,\"\\name_of_job\",,TaskScheduler,^201$,,skip].regexp(with return code 0\.$)}=0
P.S. My previous post is not for monitoring by zabbix...Last edited by Smersh; 02-09-2014, 19:16.Comment
-
Hi!
You can use the zabbix_sender too on the same .bat file redirecting the result to a character variable. I thinks is easier and faster than the log monitoring.
Regards.Number of hosts 1600,Number of items +90k,Number of triggers +22k, Number of users +100, New values per second +1270
http://zabbixes.wordpress.com/Comment
-
Comment
Comment