A little off topic, because it doesn't use jenkins-cli.jar (-:
When your jenkins ssh port is accessible, you could use something like this:
#!/bin/sh
# check which jenkins jobs are enabled/disabled, using ssh
JENKINS_CONTROLLER=
jenkins.my.org
JENKINS_SSH_PORT=2222
JENKINS_USER=jenkins
JOBS=$(ssh -l $JENKINS_USER -p $JENKINS_SSH_PORT $JENKINS_CONTROLLER list-jobs)
for J in $JOBS; do
STATUS=$(ssh -l $JENKINS_USER -p $JENKINS_SSH_PORT
$JENKINS_CONTROLLER get-job $J|grep disabled)
if [[ $STATUS = *false* ]]; then
echo "$J is enabled"
else
echo "$J is disabled"
fi
done
Cheers, Peter
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/05d52545-aa84-415f-a121-f1dbd87c7854n%40googlegroups.com.