I like the new interface!
A few minor issues I have encountered when running sar2html with the -a flag, to run it remotely on a host:
First issue:
Starting on line 675 of sar2html, it is trying to copy sar2ascii from the old location (same folder as sar2html) instead of the new location (sarFILE/sar2ascii).
675 echo "Copying sar2ascii to $NEW_HOST..."
676 expect -c "
677 set timeout 150
678 spawn scp sar2ascii $NEW_HOSTUSER@$NEW_HOST:/usr/bin/
679 expect \"*assword:*\"
680 send \"$NEW_HOSTPASS\r\"
681 expect \"*# \"" &> /dev/null
Easy fix; change line 678 to:
spawn scp sarFILE/sar2ascii $NEW_HOSTUSER@$NEW_HOST:/usr/bin/
Second issue:
-On default install, the sar2ascii script under sarFILE has no executable permissions by default- so when it is copied to a client, it cannot be executed.
Easy fix; you can either make it executable to begin with, or chmod it after copying to the client.
Third issue:
When the script runs sar2ascii remotely, it generates data for the client (it is visible in /tmp/ on the client), but it does not catch the name of the output file, so the output file is not copied over.
[root@centos6vm sar2html]# ./sar2html -a 192.168.2.70 root {pw}
Copying sar2ascii to 192.168.2.70...
Running sar2ascii on 192.168.2.70...
Downloading report from 192.168.2.70...
Extracting report...
tar (child): /var/www/html/sar2html/sarDATA/uPLOAD/.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
The culprit is around line ~704 of the sar2html executable:
reportname=`cat $SA_LOC/sar2ascii.$$ | grep "Generated report file" | awk -F/ '{ print $3 }' | awk '{ print $1 }'`
It seems to be grepping for the line "Generated report file" in the sar2ascii output to grab the report name, but that line does not exist in sar2ascii.$$ output. Instead, the sar2ascii output looks like:
spawn ssh root@192.168.2.70 bash /usr/bin/sar2ascii
Extracting sar data of 2016.01.30
Extracting sar data of 2016.01.31
Generating report file
/tmp/sar2html-localhost.localdomain-1602211833.tar.gz
Easy fix:
echo -n "Generating report file "
The -n avoids a newline at the end of the string, so that the output file will be on the same line and the grep will see it.
After doing all of the above, sar2html -a works for me.
Forgot to mention, this is for sar2html 3.0.0