ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/ihost-perl/plugins/linux/linux.c
(Generate patch)

Comparing projects/cms/source/host/ihost-perl/plugins/linux/linux.c (file contents):
Revision 1.1 by pajs, Thu Mar 7 18:47:17 2002 UTC vs.
Revision 1.3 by tdb, Fri Mar 8 14:54:32 2002 UTC

# Line 1 | Line 1
1   #include <stdio.h>
2   #include <stdlib.h>
3 < #include <local/ukcprog.h>
3 > #include "ukcprog.h"
4   #include <string.h>
5   #include <unistd.h>
6   #include <sys/utsname.h>
# Line 138 | Line 138 | void getMemInfo()
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);
# Line 413 | Line 413 | void diskStats()
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    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines