Hi @Prajwal_Kasar 1. Include the WinRM library (and its dependencies) in your app bundle before installing it on Splunk Cloud. #Within your app mkdir lib
pip install --target=lib winrm 2. Prepend...
See more...
Hi @Prajwal_Kasar 1. Include the WinRM library (and its dependencies) in your app bundle before installing it on Splunk Cloud. #Within your app mkdir lib
pip install --target=lib winrm 2. Prepend lib to sys.path in your alert script # bin/alert_winrm.py - For example
import os, sys
vendor_dir = os.path.join(os.path.dirname(__file__), "../lib")
sys.path.insert(0, vendor_dir)
import winrm
def clean_old_files(TargetServer, FolderPath, FileThresholdInMinutes, UserName, Password):
session = winrm.Session(TargetServer, auth=(UserName, Password), transport='ntlm')
# … your cleanup logic …
if __name__ == "__main__":
# parse args and call clean_old_files() 3. Package & deploy as you would normally 4. Note WinRM’s may require additional deps (requests, xmltodict, six) but I think pip should install these. Ensure Splunk Cloud can reach your Windows host on port 5985/5986 - this can be managed with ACS. Did this answer help you? If so, please consider: Adding karma to show it was useful Marking it as the solution if it resolved your issue Commenting if you need any clarification Your feedback encourages the volunteers in this community to continue contributing