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

Create script Powershell

Votes:

0

Your Vote:

Up

Down

Hi, I create a script :

Write-Host "<prtg>"
foreach($volume IN gwmi -ComputerName "127.0.0.1" -Class win32_volume)  
{
    if ($volume.DriveType -eq 3) 
    {
    $Driver =  $volume.DriveLetter
     	$freeSpace  = $volume.freespace/1073741824;
        Write-Host "<result>"
    	Write-Host "<channel>$Driver</channel>"
    	Write-Host "<value>$freeSpace</value>"
    	Write-Host "<float>1</float>"
    	Write-Host "<showTable>1</showTable>"
    	Write-Host "<showChart>1</showChart>"
    	Write-Host "<unit>Go</unit>"
    	Write-Host "<mode>Absolute</mode>"
    	Write-Host "<warning>0</warning>"
    	Write-Host "</result>"
		    
	}
}
Write-Host "<prtg>"

So a don't have a result. Can you help me ?

graphs powershell script wmi

Created on Oct 4, 2012 4:26:01 PM by  noham (0) 1

Last change on Oct 5, 2012 5:43:09 AM by  Konstantin Wolff [Paessler Support]



6 Replies

Votes:

0

Your Vote:

Up

Down

Hi,
may you post the output of the script when running the same from the powershell?
What error message do you get when using the script in a sensor?
Best regards

Created on Oct 5, 2012 5:44:20 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,

In PRTG sensor I have this:

#O132<prtg> <result> <channel>C:</channel> <value>28.4770202636719</value> <float>1</float> <showTable>1</showTable> <showChart>1</showChart> <unit>Go</unit> <mode>Absolute</mode> <warning>0</warning> </result> <result> <channel>D:</channel> <value>160.713157653809</value> <float>1</float> <showTable>1</showTable> <showChart>1</showChart> <unit>Go</unit> <mode>Absolute</mode> <warning>0</warning> </result> <prtg> 

In Powershell ISE, I have :

<prtg>
<result>
<channel>C:</channel>
<value>29.8896903991699</value>
<float>1</float>
<showTable>1</showTable>
<showChart>1</showChart>
<unit>Go</unit>
<mode>Absolute</mode>
<warning>0</warning>
</result>
<result>
<channel>D:</channel>
<value>235.045532226563</value>
<float>1</float>
<showTable>1</showTable>
<showChart>1</showChart>
<unit>Go</unit>
<mode>Absolute</mode>
<warning>0</warning>
</result>
<prtg>

I want a graph with my drivers C and D informations.

Thank you,

Created on Oct 5, 2012 9:37:42 AM by  noham (0) 1

Last change on Oct 5, 2012 9:55:03 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,
the leading message "#O132" which you are receiving in PRTG indicates you are using the wrong type of sensor. Please copy your script from \EXE to \EXEXML and use a EXE/Script Advanced Sensor instead of a "normal" EXE/Script Sensor.

Then it should work.

Best regards

Created on Oct 5, 2012 9:59:07 AM by  Konstantin Wolff [Paessler Support]

Last change on Oct 5, 2012 11:16:14 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Edit your last line

write-host "<prtg>"

it should be

write-host "</prtg>"

Created on Nov 10, 2012 5:59:48 PM by  Frank Carius (341) 1 1



Votes:

0

Your Vote:

Up

Down

Hello. I migrate an installation of PRTG from one server to another and I have two sensors with this error. Indicate to be replaced according to the type of sensor. But if I create a new sensor, I lose all historical having.

How I can make this change without losing historical data?

thanks

Created on Jan 25, 2013 7:37:48 AM by  Elvira Soto Arjona (160) 1 1



Votes:

0

Your Vote:

Up

Down

@BORJA RODRIGUEZ: In this case you will have to pause the old sensors to have access to the historical data and create new ones for further monitoring.
Best regads

Created on Jan 25, 2013 9:37:13 AM by  Konstantin Wolff [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.