Ad Widget

Collapse

SSH Check weird problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • terrydlm
    Junior Member
    • Feb 2014
    • 11

    #1

    SSH Check weird problem

    I am running an ssh check on several remote Linux machines via a Zabbix proxy which all work HOWEVER on Redhat/Centos servers I get the prompt returned in the Last Value i.e. the command I am running is ps -A | grep mysqld | wc -l and I get the return value of ]0;Ida.c972

    The 2 on the end is the value I am expecting but the stuff before it is the prompt. For some reason the client has changed the prompt in the .bashrc file so I can't interfere with that. The bit in the .bashrc file that change the prompt is below

    hostname=`hostname`".c97"

    PS1="\e[0;32m[\u@\h .c97 \w] \e[m \n[\W]$ "

    bash -c "echo -ne '\033]0;$hostname\007'"

    All the other Linux servers do this but if they are not Redhat/Centos they work fine.

    I have spent days trying to resolve this but I can't.

    I tried to use the trigger value to only use the last character of the text string i.e. the 2 but I can't get that to work either.

    Any help would be gratefully received.

    No I can't install the Zabbix Agent as much as I would like too.

    My Zabbix Server 2.4 and Proxy 2.4 are both running Centos 6.5.

    Thanks
    Last edited by terrydlm; 24-04-2014, 12:28.
  • terrydlm
    Junior Member
    • Feb 2014
    • 11

    #2
    Originally posted by terrydlm
    I am running an ssh check on several remote Linux machines via a Zabbix proxy which all work HOWEVER on Redhat/Centos servers I get the prompt returned in the Last Value i.e. the command I am running is ps -A | grep mysqld | wc -l and I get the return value of ]0;Ida.c972

    The 2 on the end is the value I am expecting but the stuff before it is the prompt. For some reason the client has changed the prompt in the .bashrc file so I can't interfere with that. The bit in the .bashrc file that change the prompt is below

    hostname=`hostname`".c97"

    PS1="\e[0;32m[\u@\h .c97 \w] \e[m \n[\W]$ "

    bash -c "echo -ne '\033]0;$hostname\007'"

    All the other Linux servers do this but if they are not Redhat/Centos they work fine.

    I have spent days trying to resolve this but I can't.

    I tried to use the trigger value to only use the last character of the text string i.e. the 2 but I can't get that to work either.

    Any help would be gratefully received.

    No I can't install the Zabbix Agent as much as I would like too.

    My Zabbix Server 2.4 and Proxy 2.4 are both running Centos 6.5.

    Thanks
    I spent a few more hours on this and eventually got it working with regex.

    Comment

    Working...