aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Ramos2025-09-26 10:37:24 +0200
committerGuillermo Ramos2025-09-26 10:51:58 +0200
commit7d35f2110fdf5478e6abb9cdda86071b32802e41 (patch)
tree5fb8e94b8044014dc5e778e739341bfe6d757414
parenta7da12cb307e6dbe33cb75cc9e6784be31ff4988 (diff)
downloadcli-7d35f2110fdf5478e6abb9cdda86071b32802e41.tar.gz
capibarra: small fixesHEADmaster
Signed-off-by: Guillermo Ramos <gramos@opennebula.io>
-rwxr-xr-xcapibarra12
1 files changed, 7 insertions, 5 deletions
diff --git a/capibarra b/capibarra
index 8040883..ef6bdf2 100755
--- a/capibarra
+++ b/capibarra
@@ -83,10 +83,12 @@ $linux_mods{'MEM'} = {
period => 5,
default_opts => {'warn' => 70, 'err' => 90},
mkcompute => sub($opts) {
- my $mused = `free | awk '/^Mem:/ {printf("%d", 100 * (\$3/\$2))}'`;
- return {
- text => sprintf("MEM %s%%", $mused),
- color => color_thresholds($mused, $opts->{warn}, $opts->{err}),
+ return sub {
+ my $mused = `free | awk '/^Mem:/ {printf("%d", 100 * (\$3/\$2))}'`;
+ return {
+ text => sprintf("MEM %s%%", $mused),
+ color => color_thresholds($mused, $opts->{warn}, $opts->{err}),
+ };
};
},
};
@@ -111,7 +113,7 @@ $linux_mods{'NET'} = {
push @wired, [0, $if, $status, $addr] if (substr($if, 0, 2) eq 'en');
push @wireless, [1, $if, $status, $addr] if (substr($if, 0, 2) eq 'wl');
}
- return { text => join ' | ', map { render_iface_linux(@$_) } @wired, @wireless };
+ return { text => join ' ยท ', map { render_iface_linux(@$_) } @wired, @wireless };
},
};