<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Encountered Winrm module not present issue on Splunk cloud for custom alert action. in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744363#M3749</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/308370"&gt;@Prajwal_Kasar&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Include the WinRM library (and its dependencies) in your app bundle before installing it on Splunk&amp;nbsp;Cloud&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;#Within your app&lt;BR /&gt;mkdir lib
pip install --target=lib winrm&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;2. Prepend lib to sys.path in your alert script&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# 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()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3. Package &amp;amp; deploy as you would normally&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4. Note&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;WinRM’s may require additional deps (requests, xmltodict, six) but I think pip should install these.&lt;/LI&gt;&lt;LI&gt;Ensure Splunk&amp;nbsp;Cloud can reach your Windows host on port&amp;nbsp;5985/5986 - this can be managed with ACS.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt; If so, please consider:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 17 Apr 2025 06:24:56 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-04-17T06:24:56Z</dc:date>
    <item>
      <title>Encountered Winrm module not present issue on Splunk cloud for custom alert action.</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744362#M3748</link>
      <description>&lt;P&gt;Hello Folks,&lt;/P&gt;&lt;P&gt;I'm encountering an issue with Splunk Cloud where it indicates that the winrm&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;module is not found. I'm attempting to install and run a custom alert action packaged Python application that uses&lt;SPAN&gt; winrm&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to establish a remote connection to a target server for cleanup processes. However, after installation and testing, I discovered that&lt;SPAN&gt; winrm&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is not installed in the Splunk Cloud environment used by our organization. Is there any workaround to achieve this and proceed further?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;ModuleNotFoundError:&lt;/SPAN&gt;&lt;SPAN class=""&gt;No&lt;/SPAN&gt; &lt;SPAN class=""&gt;module&lt;/SPAN&gt; &lt;SPAN class=""&gt;named&lt;/SPAN&gt; '&lt;SPAN class=""&gt;winrm&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Script block that uses&lt;SPAN&gt; winrm&lt;/SPAN&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;P&gt;import winrm&lt;BR /&gt;import sys&lt;BR /&gt;import argparse&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;def clean_old_files(TargetServer, FolderPath, FileThresholdInMinutes, UserName, Password):&lt;BR /&gt;# Initialize return values&lt;BR /&gt;deleted_files = []&lt;BR /&gt;deleted_count = 0&lt;/P&gt;&lt;P&gt;#print(f"Connecting to server: {TargetServer}...")&lt;BR /&gt;#remove above print statement in next deployment.&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;# Establish a WinRM session&lt;BR /&gt;session = winrm.Session(TargetServer, auth=(UserName, Password), transport='ntlm')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;#splunkcloud &lt;LI-PRODUCT title="Splunk ITSI Module for Application Performance Monitoring" id="3664"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Apr 2025 06:10:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744362#M3748</guid>
      <dc:creator>Prajwal_Kasar</dc:creator>
      <dc:date>2025-04-17T06:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Encountered Winrm module not present issue on Splunk cloud for custom alert action.</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744363#M3749</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/308370"&gt;@Prajwal_Kasar&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Include the WinRM library (and its dependencies) in your app bundle before installing it on Splunk&amp;nbsp;Cloud&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;#Within your app&lt;BR /&gt;mkdir lib
pip install --target=lib winrm&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;2. Prepend lib to sys.path in your alert script&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# 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()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3. Package &amp;amp; deploy as you would normally&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4. Note&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;WinRM’s may require additional deps (requests, xmltodict, six) but I think pip should install these.&lt;/LI&gt;&lt;LI&gt;Ensure Splunk&amp;nbsp;Cloud can reach your Windows host on port&amp;nbsp;5985/5986 - this can be managed with ACS.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt; If so, please consider:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Apr 2025 06:24:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744363#M3749</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-17T06:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Encountered Winrm module not present issue on Splunk cloud for custom alert action.</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744711#M3758</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp; for the above solution.&lt;BR /&gt;However, Now when I have added the winrm in app directory and deployed on Splunk Cloud, I am getting a new issue&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;ImportError: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2zk-fips  3 Sep 2024'. See: https://github.com/urllib3/urllib3/issues/2168]&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;And below is how i am importing the winrm&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;import argparse&lt;BR /&gt;import os&lt;BR /&gt;import sys&lt;BR /&gt;lib_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),'..','lib'))&lt;BR /&gt;sys.path.insert(0,lib_dir)&lt;BR /&gt;import winrm&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def clean_old_files(TargetServer, FolderPath, FileThresholdInMinutes, UserName, Password):&lt;BR /&gt;&lt;BR /&gt;Please guide me how i can overcome this issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 18:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744711#M3758</guid>
      <dc:creator>Prajwal_Kasar</dc:creator>
      <dc:date>2025-04-22T18:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Encountered Winrm module not present issue on Splunk cloud for custom alert action.</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744726#M3759</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/308370"&gt;@Prajwal_Kasar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means that urllib3 v2.x is not compatible with the version of OpenSSL (1.0.2) installed in your Splunk Cloud Python environment. Even though you may have bundled your own libraries, you can't change the underlying OpenSSL on Splunk Cloud.&amp;nbsp;&lt;/P&gt;&lt;P&gt;urllib3 v2.0+ dropped support for OpenSSL &amp;lt; 1.1.1 however many environments (including Splunk Cloud's Python and underlying OS) still use OpenSSL 1.0.2.&lt;BR /&gt;To fix this you need to Pin urllib3 to v1.x&lt;/P&gt;&lt;P&gt;I would try and install a specific &lt;STRONG&gt;urllib3 package 1.26.18&lt;/STRONG&gt; into your lib/deps folder along with winrm, as 1.26.18 supports OpenSSL 1.0.2.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 21:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744726#M3759</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-22T21:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Encountered Winrm module not present issue on Splunk cloud for custom alert action.</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744907#M3763</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;It did work after installing compatible version for urllib3, However now when I try testing the running the app, I am facing a new issue which says:&lt;BR /&gt;&lt;BR /&gt;'&lt;SPAN class=""&gt;Error:&lt;/SPAN&gt; &lt;SPAN class=""&gt;HTTPConnectionPool&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;host=&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;icia-mesapp1oc.na.pg.com&lt;/SPAN&gt;&lt;SPAN&gt;', &lt;/SPAN&gt;&lt;SPAN class=""&gt;port=5985&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Max&lt;/SPAN&gt; &lt;SPAN class=""&gt;retries&lt;/SPAN&gt; &lt;SPAN class=""&gt;exceeded&lt;/SPAN&gt; &lt;SPAN class=""&gt;with&lt;/SPAN&gt; &lt;SPAN class=""&gt;url:&lt;/SPAN&gt; &lt;SPAN class=""&gt;/wsman&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;Caused&lt;/SPAN&gt; &lt;SPAN class=""&gt;by&lt;/SPAN&gt; &lt;SPAN class=""&gt;NewConnectionError&lt;/SPAN&gt;&lt;SPAN&gt;('&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;urllib3.connection.HTTPConnection&lt;/SPAN&gt; &lt;SPAN class=""&gt;object&lt;/SPAN&gt; &lt;SPAN class=""&gt;at&lt;/SPAN&gt; &lt;SPAN class=""&gt;0x7f432b936c40&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Failed&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;establish&lt;/SPAN&gt; &lt;SPAN class=""&gt;a&lt;/SPAN&gt; &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;connection:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;Errno&lt;/SPAN&gt; &lt;SPAN class=""&gt;-2&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;Name&lt;/SPAN&gt; &lt;SPAN class=""&gt;or&lt;/SPAN&gt; &lt;SPAN class=""&gt;service&lt;/SPAN&gt; &lt;SPAN class=""&gt;not&lt;/SPAN&gt; &lt;SPAN class=""&gt;known&lt;/SPAN&gt;&lt;SPAN&gt;'))&lt;/SPAN&gt;'&lt;BR /&gt;&lt;BR /&gt;I have added all the possible compatible modules and dependencies.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 13:46:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/744907#M3763</guid>
      <dc:creator>Prajwal_Kasar</dc:creator>
      <dc:date>2025-04-24T13:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Encountered Winrm module not present issue on Splunk cloud for custom alert action.</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/755430#M4057</link>
      <description>&lt;P&gt;Thanks this fixed my issue importing an SDK into an app&lt;/P&gt;&lt;PRE&gt;pip &lt;SPAN class=""&gt;install&lt;/SPAN&gt; &lt;SPAN class=""&gt;urllib3&lt;/SPAN&gt;&lt;SPAN class=""&gt;==&lt;/SPAN&gt;&lt;SPAN class=""&gt;1.26&lt;/SPAN&gt;.18 &lt;SPAN class=""&gt;--target&lt;/SPAN&gt; /opt/splunk/etc/apps/&amp;lt;myApp&amp;gt;/bin --upgrade&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Nov 2025 11:03:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/Encountered-Winrm-module-not-present-issue-on-Splunk-cloud-for/m-p/755430#M4057</guid>
      <dc:creator>Esky73</dc:creator>
      <dc:date>2025-11-12T11:03:43Z</dc:date>
    </item>
  </channel>
</rss>

