A question was asked about creating a trigger that would monitor a file on a server and put the server into maintenance mode if it does not exist. The response suggested using a scheduled trigger with a PowerShell script to check the file’s presence. The suggested script can be found at \\SERVERNAME\Core\ControlUpFileShareTest.txt and can be run with the command "powershell.exe -file c:\tech\scripts\find_files.ps1."
Read the entire ‘Setting Up a File-Triggered Maintenance Mode in ControlUp’ thread below:
Anyone know if it is possible to setup af trigger that looks for at given file on a server? If it does not exist the trigger needs to put the server into maintenance mode. I cant seem to find a way todo this with the filter editor
correct we don’t monitor the file system from the triggers side. What you could do is a scheduled trigger that runs an sba, looks at the file and if it has your required state write a evenlog item that you respond to with a second trigger
I used this PS script in Scoutbees to check for the presence of a file to confirm the SBM share is available:
powershell.exe -file c:\tech\scripts\find_files.ps1
Find_files.ps1:
test-path -path \\SERVERNAME\Core\ControlUpFileShareTest.txt
Continue reading and comment on the thread ‘Setting Up a File-Triggered Maintenance Mode in ControlUp’. Not a member? Join Here!
Categories: All Archives, ControlUp for VDI, ControlUp Scripts & Triggers, ControlUp Synthetic Monitoring
