What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Custom Sensor : Powershell Script

Votes:

0

Your Vote:

Up

Down

Hello everyone,

I have a script who reads a SQL Lite database from a network share in powershell. It works perfectly directly in PowerShell. But from PRTG, the script can't access to the file. So, after few failures, I try with a mapped network drive. And it's doesn't work neither. Furthermore, when I add " wmic logicaldisk get caption " into the script, and activate the debug into PRTG to write outpu into a file, the script doesn't see the mapped drive. I think the issue comes from the Probe Service, who doesn't use the same account as me.

I also tried to add Windows Systems credentials for the network share into the settings of the object. But it doesn't work neither.

The script is available here : https://github.com/Areku95/SynoBackupSensor

Thank you in advance !

powershell prtg samba

Created on Jan 9, 2018 1:31:00 PM by  Areku (0) 1



4 Replies

Votes:

0

Your Vote:

Up

Down

Hi there,

You could check if it works when you change the service account used for the PRTG Probe Service. This can be done via the Service Console of Windows (services.msc). There you open the Properties of the "PRTG Probe Service" and change the "Log On" user to something else. Does it work afterwards?

Best regards.

Created on Jan 9, 2018 10:07:19 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

It works ! Thank you. I just had to modify the import-module with the full path.

Created on Jan 10, 2018 8:25:00 AM by  Areku (0) 1



Votes:

0

Your Vote:

Up

Down

Hello folks,

I am facing the same issue. Running a powershelgl script against a remote folder which work fine from a powershell console but not when launch from the prtg console.

I tried to replace the shared folder name by mounting it as a shared drive Z: but no chance there either.

The error message I get is:

+ $files =  Get-ChildItem -Path $path -include $include -Recurse | Sort ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (z:String) [Get-ChildItem], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
 

I did modify the "Log On" to replace it by a local one user but it hasn't resolved the issue either.

What is strange is that when I run the same script against the local drive of the machine it then works fine.

Any idea in which direction I could continue to follow?

Created on Apr 22, 2022 1:03:08 PM by  zetoune (0) 1

Last change on Apr 22, 2022 2:29:25 PM by  Felix Wiesneth [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello,
feel free to reach out to us directly via mail at [email protected] to send us screenshots of the issue and of the manual execution if you want us to take a closer look.

Created on Apr 26, 2022 7:46:21 AM by  Timo Dambach [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.