• SaltStack 远程执行



    [root@ndsfront12 ~]# salt '*' test.ping
    ndsfront21:
    True
    ndsfront12:
    True

    '*'服务器主机名

    cmd模块

    run方法


    [root@ndsfront12 ~]# salt '*' cmd.run 'df -h'
    ndsfront21:
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/rootvg-rootlv
    3.9G 686M 3.1G 19% /
    /dev/mapper/rootvg-optlv
    3.9G 229M 3.5G 7% /opt
    /dev/mapper/rootvg-homelv
    3.9G 137M 3.6G 4% /home
    /dev/mapper/rootvg-usrlv
    15G 3.4G 11G 25% /usr
    /dev/mapper/rootvg-tmplv
    3.9G 158M 3.6G 5% /tmp
    /dev/mapper/rootvg-varlv
    3.9G 231M 3.5G 7% /var
    /dev/sda1 487M 19M 444M 4% /boot
    tmpfs 7.9G 12K 7.9G 1% /dev/shm
    /dev/mapper/rootvg-cipslv
    50G 1.6G 46G 4% /cips
    /dev/mapper/rootvg-cipsapplv
    9.9G 972M 8.4G 11% /cipsapp
    ndsfront12:
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda2 3.9G 564M 3.2G 15% /
    /dev/mapper/rootvg-varlv
    3.9G 449M 3.3G 12% /var
    /dev/mapper/rootvg-usrlv
    15G 5.0G 8.8G 37% /usr
    /dev/mapper/rootvg-optlv
    3.9G 149M 3.6G 4% /opt
    /dev/mapper/rootvg-tmplv
    3.9G 181M 3.5G 5% /tmp
    /dev/mapper/rootvg-homelv
    3.9G 2.5G 1.3G 67% /home
    /dev/sda1 99M 20M 75M 21% /boot
    tmpfs 16G 16K 16G 1% /dev/shm
    /dev/mapper/rootvg-bmclv
    4.0G 1.2G 2.6G 31% /patrol
    /dev/mapper/rootvg-bealv
    25G 7.9G 16G 34% /bea
    /dev/mapper/rootvg-ndsapplv
    9.9G 646M 8.8G 7% /ndsapp
    udbnds20_szdr:/udbshare
    60G 35G 26G 59% /batchinterface
    uwbnds20_szdr:/int_file
    50G 1.8G 49G 4% /int_file
    uwbnds20_szdr:/uwbshare
    30G 5.0M 30G 1% /Interface
    [root@ndsfront12 ~]# salt 'ndsfront12' cmd.run 'uptime'
    ndsfront12:
    10:26:25 up 508 days, 20:41, 1 user, load average: 0.04, 0.04, 0.01

  • 相关阅读:
    java实现第八届蓝桥杯生命游戏
    java实现第八届蓝桥杯生命游戏
    进程&线程(&java.lang.Thread)详解
    IDEA入门(1)--lombok和Junit generator2插件的运用
    Ecplise中Junit4单元测试的基本用法
    Java 并发工具箱之concurrent包
    JDK 8 中包列表及介绍
    java中URLEncode和URLDecode
    Mybatis中输出映射resultType与resultMap的区别
    ANSI编码方式转化为UTF-8方式
  • 原文地址:https://www.cnblogs.com/python-study/p/5473162.html
Copyright © 2020-2023  润新知