Jenkins执行shell命令,提示Pseudo-terminal will not be allocated because stdin is not a terminal.

我在使用Jenkins远程执行Jmeter脚本的时候,报了这么一个错误

首先看看我的脚本

ssh root@10.***(手动打码) nohup nmon -f -m /jmeter/equ_8_shanyan/s3/down -c 320 -s 2 > a.log 2>&1 &
ssh root@10.*** 
/opt/jmeter/apache-jmeter-5.4.3/bin/jmeter -n -t /jmeter/script/equ_8_shanyan/double/down_s3.jmx -Jthread.downnum=23 -Jloop.num=1200000 -Jdura.num=600 -l /jmeter/report/equ_8_shanyan/s3/down_report/180/180down.jtl -e -o /jmeter/report/equ_8_shanyan/s3/down_report/180/ >> /jmeter/report/equ_8_shanyan/s3/down_report/log/180down.log 

开始构建后报了个错误

Started by user admin
Running as SYSTEM
Building on master in workspace /root/.jenkins/workspace/s3_up_30
[s3_up_30] $ /bin/sh -xe /opt/app/jenkins/temp/jenkins2406914613948759500.sh
/opt/app/jenkins/temp/jenkins2406914613948759500.sh: line 4: warning: here-document at line 3 delimited by end-of-file (wanted `remotessh')
+ ssh root@10.***(手动打码)
+ ssh root@10.*** nohup nmon -f -m /jmeter/equ_8_shanyan/s3/up -c 320 -s 2
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Nashorn engine is planned to be removed from a future JDK release

上面这是提示的错误,我们可以看到 Pseudo-terminal will not be allocated because stdin is not a terminal.

其实他的意思就是说想要在被Jenkins所ssh链接的地址上进行操作,我们只需要按照第四行提示的 /opt/app/jenkins/temp/jenkins4288957416165822375.sh: line 4: warning: here-document at line 3 delimited by end-of-file (wanted `remotessh')在ssh root@***后边加一个 << remotessh就可以啦

ssh root@*** << remotessh

这么操作以后,Jenkins就可以在被ssh连接的机器上运行shell命令啦

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值