since upgrading to PRTG version 9, SSH sensors leave behind a line in server's bash history file:
echo PAESSHSTART;df -TP;echo PAESSHEND
since sensor is checked every 1-5 minutes, this fills the server's history with these lines:
967 echo PAESSHSTART;df -TP;echo PAESSHEND 968 echo PAESSHSTART;df -TP;echo PAESSHEND 969 echo PAESSHSTART;df -TP;echo PAESSHEND 970 echo PAESSHSTART;df -TP;echo PAESSHEND 971 echo PAESSHSTART;df -TP;echo PAESSHEND 972 echo PAESSHSTART;df -TP;echo PAESSHEND 973 echo PAESSHSTART;df -TP;echo PAESSHEND 974 echo PAESSHSTART;df -TP;echo PAESSHEND 975 echo PAESSHSTART;df -TP;echo PAESSHEND 976 echo PAESSHSTART;df -TP;echo PAESSHEND 977 echo PAESSHSTART;df -TP;echo PAESSHEND 978 echo PAESSHSTART;df -TP;echo PAESSHEND 979 echo PAESSHSTART;df -TP;echo PAESSHEND 980 echo PAESSHSTART;df -TP;echo PAESSHEND 981 echo PAESSHSTART;df -TP;echo PAESSHEND 982 echo PAESSHSTART;df -TP;echo PAESSHEND 983 echo PAESSHSTART;df -TP;echo PAESSHEND 984 echo PAESSHSTART;df -TP;echo PAESSHEND 985 echo PAESSHSTART;df -TP;echo PAESSHEND 986 echo PAESSHSTART;df -TP;echo PAESSHEND 987 echo PAESSHSTART;df -TP;echo PAESSHEND 988 echo PAESSHSTART;df -TP;echo PAESSHEND 989 echo PAESSHSTART;df -TP;echo PAESSHEND 990 echo PAESSHSTART;df -TP;echo PAESSHEND 991 echo PAESSHSTART;df -TP;echo PAESSHEND 992 echo PAESSHSTART;df -TP;echo PAESSHEND 993 echo PAESSHSTART;df -TP;echo PAESSHEND 994 echo PAESSHSTART;df -TP;echo PAESSHEND 995 echo PAESSHSTART;df -TP;echo PAESSHEND 996 echo PAESSHSTART;df -TP;echo PAESSHEND 997 echo PAESSHSTART;df -TP;echo PAESSHEND 998 echo PAESSHSTART;df -TP;echo PAESSHEND 999 echo PAESSHSTART;df -TP;echo PAESSHEND 1000 echo PAESSHSTART;df -TP;echo PAESSHEND 1001 history
this renders bash history unusable and is not accepted as normal program behavior. is there a way of preventing these lines from being added?
Amir.
Article Comments
as a workaround, the following line can be added to the .bashrc file of the user:
export HISTIGNORE="echo PAESSHSTART;df -TP;echo PAESSHEND:ls -ltr:"
Amir.
May, 2012 - Permalink
To complete the proposed workaround (which worked for me with centos/bash) :
- first, just let PRTG flood the user's bash history with PAESSHSTART...PAESSHEND entries
- then, run in the user's command line the following:
##Back up the .bashrc file ;-) cp $HOME/.bashrc $HOME/.bashrc.`date '+%Y%m%d'`;
##add HISTIGNORE to the .bashrc file with this single line command (run it only ONE time): grep "PAESS" $HOME/.bash_history | sort | uniq > /tmp/histignore.list && echo export HISTIGNORE=\"`sed '{:q;N;s/\n/:/g;t q}' /tmp/histignore.list `\" >> $HOME/.bashrc;
3. Edit the user's .bashrc file and verify you don't have more than one declaration of HISTIGNORE... else, just merge all the existing values into a single one HISTIGNORE="...".
'hope that will work for you, best regards.
Posted by user contact_prtg here
Oct, 2013 - Permalink
We have problems at logon with last config, I use this
export HISTIGNORE="echo PAESSH_START *:[ \t]*"
Jul, 2020 - Permalink
Dear Amir,
an "unset HISTFILE;" switch is already on the wish list for SSH sensor types, but it is unlikely that we will implement this soon. Unfortunately we cannot give you an ETA.
Meanwhile we recommend you use a dedicated user account on the target machine to query monitoring data with PRTG, so the histories of your other users are not affected.
Sorry for any inconvenience that may cause on your side!
Mar, 2012 - Permalink