服务器上运行中的Jenkins版本检测


=Start=

缘由:
  • 收集服务器上运行中的Jenkins版本,了解版本分布情况,好做针对性的安全防护。
  • Java类应用的版本检测功能大同小异,方法可以移植,在此记录方便以后参考。
参考解答:

1.在 CentOS 上安装 Jenkins

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions

$ sudo yum install java-1.7.0-openjdk  #针对部分CentOS机器

$ sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
$ sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
$ sudo yum install jenkins

2.Jenkins的使用

https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins

https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins

3.获取 Jenkins 版本信息

http://stackoverflow.com/questions/34585356/get-jenkins-version-via-java-jar-jenkins-war-version-without-spam-output

$ unzip -c /usr/lib/jenkins/jenkins.war META-INF/MANIFEST.MF | egrep ^Jenkins-Version: | awk '{print $2}' | tr -d '\r'
# 或
$ java -jar /usr/lib/jenkins/jenkins.war --version
更多参考链接:
查看 Jenkins 上安装了哪些插件

http://stackoverflow.com/questions/9815273/how-to-get-a-list-of-installed-jenkins-plugins-with-name-and-version-pair

=END=

, ,

《 “服务器上运行中的Jenkins版本检测” 》 有 14 条评论

  1. Linux系统上Node.js已安装模块信息收集
    `
    1. 运行着 node 实例,且可以获取 node 的全路径信息
    2. 临时修改环境变量 PATH=${NODE%/*}:$PATH 以正确执行命令 npm ls -g –depth=0 2>/dev/null | awk ‘NR>1 {print $2}’
    3. 可能要注意的问题:
    权限是否正确;
    路径是否正确(若不正确则只能获取全局状态下的已安装模块);
    环境变量是否正确(/usr/bin/env: node: 没有那个文件或目录);
    `
    获取 node.js 已安装的模块信息:
    get all nodejs modules
    centos get installed nodejs modules
    参考链接:
    http://stackoverflow.com/questions/13981938/print-a-list-of-all-installed-node-js-modules
    http://stackoverflow.com/questions/17937960/how-to-list-npm-user-installed-packages
    http://stackoverflow.com/questions/5926672/where-does-npm-install-packages

    http://serverfault.com/questions/299288/how-do-you-install-node-js-on-centos
    http://tecadmin.net/install-latest-nodejs-and-npm-on-centos/
    http://ask.xmodulo.com/install-node-js-linux.html

  2. 一次Web访问的顺序:Web浏览器 -> Web服务器(狭义) -> (Web容器 -> )应用服务器 -> 数据库服务器

    #Java (java进程)
    Spring Struts/Struts2 [WebFramework]
    Jenkins [WebApp]

    #Python (python进程)
    Django Flask Tornado Pyramid web2py [WebFramework]

    #PHP (nginx/httpd)+(php-fpm/php-cgi/…进程)
    Laravel Yii Symfony CakePHP ThinkPHP zend [WebFramework]
    WordPress Joomla Drupal Typecho PHPCMS Discuz! [WebApp]

    #Ruby (ruby进程)
    RoR Sinatra [WebFramework]

    #Nodejs (node进程)
    Express [WebFramework]

    #Golang (go进程)
    Revel Beego [WebFramework]

    https://en.wikipedia.org/wiki/Web_framework#External_links
    https://github.com/showcases/web-application-frameworks

    Jenkins
    https://jenkins.io/doc/ # `java -jar jenkins.war`
    https://ixyzero.com/blog/archives/2627.html

  3. 如何检测 Django 的版本
    https://stackoverflow.com/questions/6468397/how-to-check-django-version

    如何检测 Flask 的版本
    https://stackoverflow.com/questions/5285858/determining-what-version-of-flask-is-installed

    如何检测 Tornado 的版本
    https://stackoverflow.com/questions/31146153/get-python-tornado-version
    `
    $ /proc/$pid/exe -c “import django; print(django.get_version())”
    $ /proc/$pid/exe -c “import flask; print(flask.__version__)”
    $ /proc/$pid/exe -c “import tornado; print(tornado.version)”
    `

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注