Reputation: 21
Here is a sample of the code and the error message from the Netapp. As well as an echo of what it is sending. The script is using a -x so i can see what's happening.
while read -r vserverdrt lif ip mask port
do
echo "$vserverdrt $lif $ip $mask $port"
echo
ssh -n root@NETAPP net interface create -vserver $vserverdrt -lif $lif -service-policy default-data-files -address $ip -netmask $mask -home-port $port -home-node NETAPP-02 -status-admin up
done < /drtest/netapp/files/vservnetdrt.txt
Output:
+ read -r vserverdrt lif ip mask port
' echo 'lebdrtestsvm1-drt LIF_lebdrtestsvm1-drt_56 10.254.56.69 255.255.255.0 a0c-56
lebdrtestsvm1-drt LIF_lebdrtestsvm1-drt_56 10.254.56.69 255.255.255.0 a0c-56
+ echo
+ ssh -n root@NETAPP net interface create -vserver lebdrtestsvm1-drt -lif LIF_lebdrtestsvm1-drt_56 -service-policy default-data-files -address 10.254.56.69 -netmask 255.255.255.0 -home-port $'a0c-56\r' -home-node NETAPP-02 -status-admin up
Last login time: 1/17/2025 15:38:10
(network interface create)
is an invalid port on node NETAPP-02.
As you can see the -home-port $port is supposed to be a0c-56, but the loop is sending $'a0c-56\r'.
This is happening on one host, but if i run the same script on a different host, it works perfectly. I've gone through the root environment on both systems and they are both the same. But obviously there is something different i'm not seeing. Any help on where to look would be much appreciated!
Upvotes: 1
Views: 35