resource-agents
resource-agents copied to clipboard
Kamailio resource agent: tput: No value for $TERM and no -T specified
When running the Kamailio resource agent I receive the following in /var/log/messages whenever the resource is checked:
notice: kamailio_monitor_10000:2784:stderr [ TERM environment variable not set. ] notice: kamailio_monitor_10000:2784:stderr [ tput: No value for $TERM and no -T specified ]
I'm running CentOS 7.3 with Corosync/Pacemaker installed via the CentOS repos.
My apologies in advance if this is a configuration issue on my part.
The issue occurs because the monitor facility uses the "kamctl monitor" script. This script calls rpc_kamailio_monitor() in kamctl.rpcfifo. That function runs two commands that expect a terminal. The first is "clear" which gives the first notice and the second is "tput clear" which gives the second notice.
A resolution would be to check for $TERM and only execute the commands if $TERM is set. This may be more appropriately addressed by the Kamailio project.
Maybe a fix would be to add [ -z "$TERM" ] && TERM="xterm"?
I don't think that would be appropriate, because there is no terminal when the resource agent runs the monitor task.
[ -z "$TERM" ] || clear and [ -z "$TERM" ] || tput clear
might be a solution.
Ah. Fixing it in kamctl would be even better :+1: