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

ssh script sensor to grep error count in var log messages. (response not well-formed (code pe132))

Votes:

0

Hello, I am using the below ssh script for my ssh script sensor to grep error messages in log. however this give me error - response not well-formed (code pe132) . Cam someone help in this.

script is as below.

#!/bin/bash
# definethe log path
LOG_FILE="/var/log/messages"

#read the last 100 lines of the log file and search for the keyword "error"
ERROR=$(tail -n 100 "$LOG_FILE" | grep "error")

#count the number of error occurences
ERROR_COUNT=$(echo "$ERRORS" | wc -l)

# output the error count to stdout
echo "ERRORS:$ERROR_COUNT"

# output the error messages to stdout
echo "$ERRORS" | while read -r line; do
echo "ERROR: $line"
done

customsensor ssh sshscript unixlog

Created on Mar 16, 2023 4:24:00 PM

Last change on Mar 22, 2023 6:06:01 AM by  Felix Wiesneth [Paessler Support]



1 Reply

Votes:

0

Hello,

this sensor expects a numerical value as return.

Please refer to the sensors manual page for an example.

If you need further assistance with this sensor, feel free to open a support ticket.


Kind Regards
Johannes Beyerlein, Paessler Technical Support

Created on May 26, 2023 8:25:16 PM by  Johannes Beyerlein [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.