Expression |
/^([0-2][0-9]\:[0-5][0-9]\:[0-5][0-9])\s+up\s+([0-9\:]{1,5})\s*(days|day|min|mins)?(?:\,\s+([0-9\:]{1,5})\s*(days|day|min|mins)?)?\,\s+([0-9]{1,4})\susers?\,\s+load\s+average\:\s+([0-9\.]{1,6})\,\s+([0-9\.]{1,6})\,\s+([0-9\.]{1,6})$/ |
Description |
Take the output of the uptime command and split it into a useful array.
Use array combine with the below keys array for usefull output.
array('raw','time','up1','unit1','up2','unit2','users','1min','5min','15min') |
Matches |
13:21:33 up 219 days, 1:11, 1 user, load average: 0.00, 0.00, 0.00 | 21:17:21 up 19 days, 9:34, 1 user, load average: 0.00, 0.00, 0.00 | 21:17:21 up 19 days, 9:34, 1 user, load average: 12.30, 5.02, 1.20 |