(No output on stdout) stderr

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
redraptor
Posts: 1
Joined: Fri Mar 19, 2021 8:39 am

(No output on stdout) stderr

Post by redraptor »

Hi, im using a sript called tsmmonitor.. I get answer by ssh but in dashboard web, it fails. In other words, the SSH connection is working, but the plugin that is being executed is not working. I will appreciatte ur help, thanks.

(No output on stdout) stderr: /usr/local/nagios/libexec/tsmmonitor: line 410: /dev/tty: No such device or address

code:

# Connect to tsm server and execute the sql statement
run_select )
local temp_output
local check="$2"
local sql="$3"

# Connect to tsm server and run the select statement
temp_output=$($TSM_CMD "$sql")

# test if dsmamdc was executed without error
if [ "$?" = "0" -o "$?" = "11" ]
then
_Debug "$temp_output" > /dev/tty
# Check the tsm command return code
_tsmmonitor_tool check_retcode $check "$temp_output"
echo "$temp_output"

else
_Debug "$temp_output" > /dev/tty
echo "Error executing the command dsmadmc" > /dev/tty
echo
echo "$temp_output"
exit 3
fi
;;
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: (No output on stdout) stderr

Post by pbroste »

Hello @redraptor

Thanks for reaching out, want to verify /dev/tty out, by running:

Code: Select all

echo hello > /dev/tty
We should see:
hello
How about 'ls -lahrt' on it and we should see: "crw-rw-rw- 1 root tty 5, 0 xxx x x /dev/tty"

Code: Select all

ls -lahrt
We should see the same results when using redirect '2>&1'. Example:

Code: Select all

echo hello 2>&1
Substitute 2>&1 for /dev/tty and let us know the results,
Perry
Locked