What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

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

ArcServer UDP Datastore monitor CLI

Votes:

0

I'm looking to run: as_dsmgr.exe /DSStat "Data store"

Which returns:

*************

Deduplication enabled: True Overall Status: Stopping

Data Store data (size in bytes): Stored Data: 47533135358418 Deduplication ratio: 79.57% Compression ratio: 27.69% Overall Data Reduction ratio: 85.23% Space occupied size: 7022251653519

Backup destination path status (size in bytes): Volume total size: 18000172277760 Volume free size: 10949416239104 Volume used size: 7050756038656 Data folder size: 13431878476

Index role information (size in bytes): Job status: no job Index volume total size: 18000172277760 Index volume free size: 10949416239104 Index folder size: 55123280259 nPort: 5008

Hash role information (size in bytes): Hash volume total size: 18000172277760 Hash volume free size: 10949416239104 Hash folder size: 12377621024 Memory total size: 50330615808 Memory available size: 4471898112 Hash used Memory size: 12537233408 Port: 5010

Data role information (size in bytes): Data volume total size: 18000172277760 Data volume free size: 10949416239104 Data folder size: 6955747612672 Port: 5009

*************

What I care bout is the value after Overall Status: which if != 'Running'

Then needs to be marked as down.

I don't know where to start.

arcserve-udp cli exe

Created on Jan 11, 2022 11:08:37 AM



5 Replies

Votes:

0

Hello,

Thank you for your message.

According to what you would like to achieve, you need to develop and use a custom script with the EXE/Script or EXE/Script Advanced sensor. The latter should follow the steps below:

  • Execute the command you provided on the probe server or target device (remotely)
  • Keep the first line of the output
  • Parse the result to keep "Overall Status: <status>" or simply look for the word "running"
  • If that word exists, then the script should return a corresponding code:
    • 0: not running
    • 1: running

That way, you can configure limits in the settings of the channel in PRTG or a custom lookup.

Please, note that the response returned by the script must follow the format corresponding to the sensor used. You will find it in this manual: https://www.paessler.com/manuals/prtg/custom_sensors.

If you have questions, do not hesitate.

Regards.

Created on Jan 12, 2022 9:44:44 AM by  Florian Lesage [Paessler Support]

Last change on Jan 12, 2022 10:10:17 AM by  Florian Lesage [Paessler Support]



Votes:

0

To close this request, my script looks as follows:

param ([string]$datastore)
invoke-command -computername DEVICE -scriptblock {
cd 'C:\Program Files\Arcserve\Unified Data Protection\Engine\BIN'
$a = .\as_dsmgr.exe /DSStat $Using:datastore

$lineNumber = 0
for($i = 0; $i -lt $a.length; $i++){
	if($a[$i] -like'*Overall Status:*') {
		$lineNumber = $i
		break
	}
}

if($a[$lineNumber] -like'*Running*') {
	Write-Host '0:Running'
}
elseif ($a[$lineNumber] -like'*Starting*'){
	Write-Host '1:Starting'
}
elseif ($a[$lineNumber] -like'*Stopping*'){
	Write-Host '1:Stopping'
}
elseif ($a[$lineNumber] -like'*Stopped*'){
	Write-Host '2:Stopped'
}
elseif ($a[$lineNumber] -like'*Status*'){
	Write-Host '2:State not captured in script'
}
else{
	Write-Host $a
}
}

I have then set PRTG to use the windows credentials then set the error and warning thresholds to be 0 and 1. And set 'Value' as the primary channel

Created on Jan 12, 2022 10:13:43 AM

Last change on Jan 12, 2022 11:33:53 AM by  Florian Lesage [Paessler Support]



Votes:

0

Thank you for sharing the script. Just to make sure that it is correct, it does work as you expected ?

Created on Jan 12, 2022 10:19:25 AM by  Florian Lesage [Paessler Support]



Votes:

0

Yes, all works well. i need to improve the final if statement for unexpected output, as i currently appears Green so I need to tweak the last write-host to have an error value. Other than that I'm happy.

Next step would be to pass the server variable as currently the server name is hard coded.

Created on Jan 12, 2022 10:24:59 AM

Last change on Jan 12, 2022 11:34:46 AM by  Florian Lesage [Paessler Support]



Votes:

0

Thank you for the confirmation.

Regarding the server name, you can pass it to the script by using the placeholder %host (device IP/DNS address) or "%device" (device name) in the Parameters field of the sensor.

Then for the else statement, you need to return an exit code different than 0 to trigger an error in the sensor. You will find the list of exit codes here: https://www.paessler.com/manuals/prtg/custom_sensors#standard_exescript.

The sensor should then behave as you want it to do.

Created on Jan 12, 2022 10:33:18 AM by  Florian Lesage [Paessler Support]




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.