Update node-status docs

This commit is contained in:
Alex Dadgar 2016-06-16 14:47:06 -07:00
parent 0de6735c22
commit fc8254d157
2 changed files with 151 additions and 41 deletions

View file

@ -40,9 +40,9 @@ Usage: nomad node-status [options] <node>
returned includes only nodes which jobs may be scheduled to, and
includes status and other high-level information.
If a node ID is passed, information for that specific node will
be displayed. If no node ID's are passed, then a short-hand
list of all nodes will be displayed. The -self flag is useful to
If a node ID is passed, information for that specific node will be displayed,
including resource usage statistics. If no node ID's are passed, then a
short-hand list of all nodes will be displayed. The -self flag is useful to
quickly access the status of the local node.
General Options:
@ -51,21 +51,21 @@ General Options:
Node Status Options:
-self
Query the status of the local node.
-stats
Display detailed resource usage statistics.
-allocs
Display a count of running allocations for each node.
-short
Display short output. Used only when a single node is being
queried, and drops verbose output about node allocations.
-verbose
Display full information.
-stats
Display detailed resource usage statistics
-self
Query the status of the local node.
-allocs
Display a count of running allocations for each node.
`
return strings.TrimSpace(helpText)
}
@ -225,7 +225,7 @@ func (c *NodeStatusCommand) formatNode(client *api.Client, node *api.Node) int {
// Format the header output
basic := []string{
fmt.Sprintf("Node ID|%s", limit(node.ID, c.length)),
fmt.Sprintf("ID|%s", limit(node.ID, c.length)),
fmt.Sprintf("Name|%s", node.Name),
fmt.Sprintf("Class|%s", node.NodeClass),
fmt.Sprintf("DC|%s", node.Datacenter),

View file

@ -23,10 +23,10 @@ high-level list of all known nodes. This list output contains less information
but is a good way to get a bird's-eye view of things.
If there is an exact match based on the provided node ID or prefix, then that
particular node will be queried, and detailed information will be displayed.
Otherwise, a list of matching nodes and information will be displayed. If
running the command on a Nomad Client, the -self flag is useful to quickly
access the status of the local node.
particular node will be queried, and detailed information will be displayed,
including resource usage statistics. Otherwise, a list of matching nodes and
information will be displayed. If running the command on a Nomad Client, the
-self flag is useful to quickly access the status of the local node.
## General Options
@ -34,11 +34,18 @@ access the status of the local node.
## Node Status Options
* `-short`: Display short output. Used only when querying a single node.
* `-verbose`: Show full information.
* `-allocs`: Show running allocations per node.
* `-self`: Query the status of the local node.
* `-stats`: Display detailed resource usage statistics.
* `-allocs`: When a specific node is not being queried, shows the number of
running allocations per node.
* `-short`: Display short output. Used only when querying a single node.
* `-verbose`: Show full information.
## Examples
List view:
@ -69,6 +76,11 @@ Class = <none>
DC = dc1
Drain = false
Status = ready
Uptime = 17h2m25s
Allocations
ID Eval ID Job ID Task Group Desired Status Client Status
0b8b9e37 8bf94335 example cache run running
```
Full output for a single node:
@ -76,19 +88,28 @@ Full output for a single node:
```
$ nomad node-status 1f3f03ea
ID = c754da1f
Name = nomad
Class = <none>
DC = dc1
Drain = false
Status = ready
Name = nomad-server01
Class = <none>
DC = dc1
Drain = false
Status = ready
Uptime = 17h42m50s
==> Resource Utilization
CPU Memory MB Disk MB IOPS
0/2600 0/1997 0/34374 0/0
Allocated Resources
CPU Memory Disk IOPS
500/2600 256 MiB/2.0 GiB 300 MiB/32 GiB 0/0
==> Allocations
Allocation Resource Utilization
CPU Memory
430/2600 199 MiB/2.0 GiB
Host Resource Utilization
CPU Memory Disk
513/3000 551 MiB/2.4 GiB 4.2 GiB/52 GiB
Allocations
ID Eval ID Job ID Task Group Desired Status Client Status
3d743cff 2fb686da example cache run complete
7bff7214 b3a6b9d2 example cache run running
```
Using `-self` when on a Nomad Client:
@ -96,19 +117,99 @@ Using `-self` when on a Nomad Client:
```
$ nomad node-status -self
ID = c754da1f
Name = nomad
Name = nomad-client01
Class = <none>
DC = dc1
Drain = false
Status = ready
Uptime = 17h7m41s
==> Resource Utilization
CPU Memory MB Disk MB IOPS
0/2600 0/1997 0/34374 0/0
Allocated Resources
CPU Memory Disk IOPS
2500/2600 1.3 GiB/2.0 GiB 1.5 GiB/32 GiB 0/0
==> Allocations
Allocation Resource Utilization
CPU Memory
2200/2600 1.7 GiB/2.0 GiB
Host Resource Utilization
CPU Memory Disk
2430/3000 1.8 GiB/2.4 GiB 6.5 GiB/40 GiB
Allocations
ID Eval ID Job ID Task Group Desired Status Client Status
3d743cff 2fb686da example cache run complete
0b8b9e37 8bf94335 example cache run running
b206088c 8bf94335 example cache run running
b82f58b6 8bf94335 example cache run running
ed3665f5 8bf94335 example cache run running
24cfd201 8bf94335 example cache run running
```
Using `-stats` to see detailed to resource usage information on the node:
```
$ nomad node-status -stats c754da1f
ID = c754da1f
Name = nomad-client01
Class = <none>
DC = dc1
Drain = false
Status = ready
Uptime = 17h7m41s
Allocated Resources
CPU Memory Disk IOPS
2500/2600 1.3 GiB/2.0 GiB 1.5 GiB/32 GiB 0/0
Allocation Resource Utilization
CPU Memory
2200/2600 1.7 GiB/2.0 GiB
Host Resource Utilization
CPU Memory Disk
2430/3000 1.8 GiB/2.4 GiB 3.9 GiB/40 GiB
CPU Stats
CPU = cpu0
User = 96.94%
System = 1.02%
Idle = 2.04%
CPU = cpu1
User = 97.92%
System = 2.08%
Idle = 0.00%
Memory Stats
Total = 2.4 GiB
Available = 612 MiB
Used = 1.8 GiB
Free = 312 MiB
Disk Stats
Device = /dev/mapper/ubuntu--14--vg-root
MountPoint = /
Size = 38 GiB
Used = 3.9 GiB
Available = 32 GiB
Used Percent = 10.31%
Inodes Percent = 3.85%
Device = /dev/sda1
MountPoint = /boot
Size = 235 MiB
Used = 45 MiB
Available = 178 MiB
Used Percent = 19.17%
Inodes Percent = 0.48%
Allocations
ID Eval ID Job ID Task Group Desired Status Client Status
0b8b9e37 8bf94335 example cache run running
b206088c 8bf94335 example cache run running
b82f58b6 8bf94335 example cache run running
ed3665f5 8bf94335 example cache run running
24cfd201 8bf94335 example cache run running
```
To view verbose information about the node:
@ -121,16 +222,25 @@ Class = <none>
DC = dc1
Drain = false
Status = ready
Uptime = 17h7m41s
==> Resource Utilization
CPU Memory MB Disk MB IOPS
0/2600 0/1997 0/34374 0/0
Allocated Resources
CPU Memory Disk IOPS
2500/2600 1.3 GiB/2.0 GiB 1.5 GiB/32 GiB 0/0
==> Allocations
Allocation Resource Utilization
CPU Memory
2200/2600 1.7 GiB/2.0 GiB
Host Resource Utilization
CPU Memory Disk
230/3000 121 MiB/2.4 GiB 6.5 GiB/40 GiB
Allocations
ID Eval ID Job ID Task Group Desired Status Client Status
3d743cff-8d57-18c3-2260-a41d3f6c5204 2fb686da-b2b0-f8c2-5d57-2be5600435bd example cache run complete
==> Attributes
Attributes
arch = amd64
cpu.frequency = 1300.000000
cpu.modelname = Intel(R) Core(TM) M-5Y71 CPU @ 1.20GHz