21 |
|
# You'd be silly not to use this ;) |
22 |
|
use strict; |
23 |
|
|
24 |
< |
# Path's |
24 |
> |
# Paths |
25 |
|
my($topbin) = "/usr/local/sbin/top"; |
26 |
|
my($dfbin) = "/usr/bin/df"; |
27 |
|
my($usersbin) = "/usr/ucb/users"; |
113 |
|
chop $users; |
114 |
|
my($users_count) = 0; |
115 |
|
$users_count++ while $users =~ /\w+/g; |
116 |
< |
my($users_list) = $users; |
116 |
> |
my($users_list) = $users." "; |
117 |
|
|
118 |
|
&print_pair(1, "packet.users.count", $users_count); |
119 |
|
&print_pair(0, "packet.users.list", $users_list); |
193 |
|
# sub to get system uptime. |
194 |
|
sub include_uptime() { |
195 |
|
|
196 |
– |
# Need a regexp guru to strip the junk on this line |
196 |
|
my($uptime) = `$uptimebin`; |
197 |
+ |
$uptime =~ /up ([0-9]+) .*, ([0-9]+:[0-9]+)/; |
198 |
+ |
$uptime = "$1:$2"; |
199 |
|
|
200 |
|
&print_pair(0, "packet.os.uptime", $uptime); |
201 |
|
|
202 |
< |
} |
202 |
> |
} |