When adding a component to a monitoring template, does the script have to be a perl script?
Can I use a normal shell script and for the command line just use ${script}?
I'm testing the monitoring of a HP-UX box with a simple "uptime" script and am not able to get a good result back.
My script is as follows.....
-------------------------------------------------
#!/bin/sh
utime=`uptime`
days=`uptime | awk '{print $3}'`
echo "Message: $utime"
echo "Statistic: $days"
exit 0
-------------------------------------------------
The script runs fine on the box outputting both the message and the statistic.
I have ${script} in the "command line" of the component section.
I am getting logged in and the script is attempting to run.
The status on the APM Component Details is as follows...
Linux script execution error. Script output did not contain required field "Statistic:". Actual script output begins ""
This is what the history is showing on the server....
sh
PS1='__SOLAR_WINDS_APM__'
cd /tmp
cd ~
pwd
cat>/tmp/APM_Script__61a96c88-ab94-42ce-9b01-9e660da8f96e.pl
chmod +x /tmp/APM_Script__61a96c88-ab94-42ce-9b01-9e660da8f96e.pl
/tmp/APM_Script__61a96c88-ab94-42ce-9b01-9e660da8f96e.pl & PID=$! ; (sleep 300; kill -KILL "${PID}") & 2>/dev/null; KILLER=$! ; wait "${PID}" 2>/dev/null; R=$? ; kill -HUP "${KILLER}" 2>/dev/null; rm -f /tmp/APM_Script__61a96c88-ab94-42
Being that it names the temp script xxx.pl, leads me to believe that SolarWinds wants to use perl for the scripts? I am able to run the temp xxx.pl script using the shell and the output looks good.
Any thoughts?
Mukey