summaryrefslogtreecommitdiff
path: root/op-mode-definitions/show-environment.xml
blob: 88e1718aa26b659995d222497831a7f060505c40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?xml version="1.0"?>
<interfaceDefinition>
  <node name="show">
    <children>
      <node name="environment">
        <properties>
          <help>Show current system environmental conditions</help>
        </properties>
        <children>
          <leafNode name="sensors">
            <properties>
              <help>Show hardware monitoring results</help>
            </properties>
            <!-- Linux always adds "hypervisor" to CPU flags -->
            <command>if ! grep -q hypervisor /proc/cpuinfo; then /usr/bin/sensors --no-adapter; else echo "VyOS running under hypervisor, no sensors available"; fi</command>
          </leafNode>
        </children>
      </node>
    </children>
  </node>
</interfaceDefinition>