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 and script advanced problems on AIX 6.1

Votes:

0

Hi

I've got problems adding sensors for an AIX 6.1 machine.

We're running PRTG 13.3.5.2952. We would like to monitor an AIX 6.1 machine using the "SSH script" or "SSH script advanced" sensor types. I've created the device for the machine in prtg, and set the login credentials for SSH on the device itself. I've confirmed that this works by trying to add an "SSH disk free" sensor. This sensor works great, PRTG logs on and pulls info about the mount points and this data is shown just fine in the web ui. This tells me that the device itself seems to be setup correctly.

I've created the /var/prtg/scripts and the /var/prtg/scriptsxml directories on the AIX machine. There is a script inside of the scriptsxml directory which simply returns dummy values in xml format. The credentials supplied on the device have permissions to execute this script. When i try to select "Add Sensor" on the device and then select either the "SSH script" or "SSH script advanced" sensor type the system goes to "Preparing sensor settings" and then pops up an error message stating:

"Sorry, the scan for available monitoring items has failed Error Message ls: Not a recognized flag: M Sensor Type SSH Script Device <MyDeviceNameHere>"

To me it would appear that the login succeeds, but then when trying to scan for available scripts PRTG runs an "ls" command with a "-M" (capitlized) as an argument, which the ls command does not like.

Can these types of sensors not work on AIX 6.1? Have i forgotten to create some directory structure on the AIX machine necessary for this to functtion? Please assist.

If we cannot implement these script based sensors on our AIX unix infrastructure it will be difficult to achieve the level of monitoring we desire for our systems.

Best Regards

Peter Dahlgaard

aix pttg ssh

Created on Oct 8, 2013 1:49:27 PM



5 Replies

Accepted Answer

Votes:

0

Hello,

thank you very much for your KB-Post. Unfortunately this is a bug in PRTG, the fix should soon reach the stable builds. As soon as the stable builds have a 7 in the third digit of the version number (so 13.x.7) the fix should be included. Please bear with us.

best regards.

Created on Oct 9, 2013 2:41:40 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Hi

This is just a quick followup! We've just had a chance to upgrade our PRTG installation. The remote probe we're using is now running version 13.4.7.3674, and i can confirm that the bug is fixed. The remote probe is now able to carry out a login on our AIX server, retrieve the correct listing of available scripts and use them in sensors afterwards!

Thank you for your help! Best Regards Peter Dahlgaard

Created on Dec 16, 2013 2:14:20 PM



Votes:

0

Hello Mr Dahlgaard, I am also interested to setup AIX Monitoring using PRTG. Please let me know if in case you have some documentation or some sample scripts, how to achieve this AIX 6.1 or 7.1 Monitoring using PRTG. This would be of great help.

Thank you, Regards, Eswaran

Created on Jul 2, 2015 11:42:37 AM



Votes:

8

Hi Eswaran

I'm glad to share what i can. My original problem turned out to be a bug in an earlier version of PRTG when dealing specifically with the AIX operating system. This was pointed out by Torsten Lindner from the Paessler support team. Since then we have upgraded to a never version, and we've not had any problems.

We've mostly followed the guidelines presented here: https://www.paessler.com/manuals/prtg/ssh_script_sensor

A prerequisite for the following is that it is possible to log on to the AIX server via SSH.

Here is a quick list of steps we need to perform to setup a script on an AIX server:

  1. Define a device in PRTG with the hostname of your AIX server
  2. Set credentials for "LINUX/SOLARIS/MAC OS (SSH/WBEM) SYSTEMS) on this device to reflect a user that exists on your AIX server.
  3. On the AIX server make sure the directories: "/var/prtg/scripts" and /var/prtg/scriptsxml" exist.
  4. Make sure that the user defined in step 2 has access permissions to read and execute on the folders defined in step 3
  5. If you are making simple SSH based scripts they go in the "/var/prtg/scripts" directory. If you are making advanced scripts (which return multiple channels in XML format) they go in the "/var/prtg/scriptsxml" directory. At the bottom of this post i've included an example of a very simple advanced ssh script. REMEMBER: Make sure the user defined in step 2, has read and execute permissions on your script file!
  6. Once your script is in place add a sensor to your device in PRTG and select the type "SSH Script" or "SSH Script Advanced" depending on your type of server. Once you've done this PRTG should present you with a list of the scripts found in the relevant directory of the server and you can select the script and provide any required arguments for the script as well

Once you've added the script you should be good to go and PRTG should now be able to login to your AIX, run your script and pickup the result for you.

Here is an example of a simple "SSH Script Advanced" that returns two channels to PRTG in a single sensor via the XML notation PRTG expects (more details on this format can be found in your PRTG installation under Setup -> PRTG API). This script is made in ksh, but you can use any type of executable you want like perl scripts, bash scripts or even binaries.

#!/usr/bin/ksh echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" echo "<prtg>" echo "<result>" echo "<channel>First Channel Name</channel>" echo "<value>5</value>" echo "</result>" echo "<result>" echo "<channel>Second Channel Name</channel>" echo "<value>15</value>" echo "</result>" echo "<Text>This is the status text for the sensor</Text>" echo "</prtg>"

I hope it helps!

Best Regards

Peter

Created on Jul 2, 2015 12:53:17 PM



Votes:

0

Hello Peter,

Thank you for your detailed explanation. Sorry for the late reply.

Now I have configured PRTG with SSH Shell Scripts for monitoring AIX. I just want to start with the simple script which checks one of our server's availability using Ping.

#!/bin/sh

# -q quiet
# -c nb of pings to perform

ping -q -c5  ipaddress > /dev/null

if [ $? -eq 0 ]
then
        echo "0:1:Ping check ok"
exit 0
else
        echo "0:1:NOT OK!!!"
fi
--

if the ipaddress is reachable then it works as expected and send the message "Ping Check ok". But when the ip address is not reachable, then it gives the error message " Shell Timeout after 5 seconds"

I just want to get the custom message "NOT OK" in PRTG.

is there a way to achieve this?

Thank you and have a nice week ahead.

Regards, Karthick Eswaran

Created on Dec 14, 2015 3:45:17 PM

Last change on Dec 14, 2015 3:50:09 PM by  Torsten Lindner [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.