| 138 |
|
|
| 139 |
|
} |
| 140 |
|
|
| 141 |
< |
printf("packet.memory.total %ld\n",memstat[0]); |
| 141 |
> |
printf("packet.memory.total %ld\n",((memstat[0]/1024)/1024)); |
| 142 |
|
/* Due to batty linux we do some maths to work out roughly what the free ram is */ |
| 143 |
< |
tmp=memstat[1] - memstat[4]; |
| 143 |
> |
tmp=((memstat[1] - memstat[4])/1024)/1024; |
| 144 |
|
printf("packet.memory.used %ld\n",tmp); |
| 145 |
< |
tmp=memstat[2] + memstat[4]; |
| 145 |
> |
tmp=((memstat[2] + memstat[4])/1024)/1024; |
| 146 |
|
printf("packet.memory.free %ld\n",tmp); |
| 147 |
|
|
| 148 |
< |
printf("packet.swap.total %ld\n",swapstat[0]); |
| 149 |
< |
printf("packet.swap.used %ld\n",swapstat[1]); |
| 150 |
< |
printf("packet.swap.free %ld\n",swapstat[2]); |
| 148 |
> |
printf("packet.swap.total %ld\n",((swapstat[0]/1024)/1024)); |
| 149 |
> |
printf("packet.swap.used %ld\n",((swapstat[1]/1024)/1024)); |
| 150 |
> |
printf("packet.swap.free %ld\n",((swapstat[2])/1024)/1024); |
| 151 |
|
|
| 152 |
|
free(mem); |
| 153 |
|
free(swap); |
| 413 |
|
printf("packet.disk.p%d.attributes.kbytes %ld\n",diskcnt,bstok*df.f_blocks); |
| 414 |
|
printf("packet.disk.p%d.attributes.used %ld\n" ,diskcnt, ((bstok*df.f_blocks)-(bstok*df.f_bfree))); |
| 415 |
|
printf("packet.disk.p%d.attributes.avail %ld\n", diskcnt, (df.f_bsize/1024)*df.f_bavail); |
| 416 |
– |
/* |
| 416 |
|
printf("packet.disk.p%d.attributes.totalinodes %ld\n", diskcnt, df.f_files); |
| 417 |
|
printf("packet.disk.p%d.attributes.freeinodes %ld\n", diskcnt, df.f_ffree); |
| 419 |
– |
*/ |
| 418 |
|
diskcnt++; |
| 419 |
|
} |
| 420 |
|
|