The output is not empty. This is the result after running vnstat -d on the server.
enter image description here
and this is the output when I put the line
echo "output"
after output variable in the code