Compare commits

..

7 commits

Author SHA1 Message Date
Sven Slootweg 3b778e6d2f Also include XFS filesystems in the filesystem data 2013-05-29 20:00:05 +02:00
Sven Slootweg 42cb26f273 Replace Python 2.7+ timedelta call with code that also works in older versions 2013-05-29 19:58:11 +02:00
Sven Slootweg 3f4a1e15d7 Properly configure home directory for pyLSA user 2013-05-29 19:57:54 +02:00
Sven Slootweg 81127ba283 Include load average 2013-04-01 21:49:32 +02:00
Sven Slootweg 14441b3543 Merge branch 'master' into develop 2013-03-31 22:00:53 +02:00
Sven Slootweg f95a28e717 Add build script 2013-03-31 21:52:10 +02:00
Sven Slootweg 6b19e22e82 Add .gitignore 2013-03-31 21:52:03 +02:00
4 changed files with 17 additions and 4 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
pylsa_sfx.py

9
build.sh Executable file
View file

@ -0,0 +1,9 @@
cd installer
echo "Copying needed files for SFX..."
mkdir src/
cp ../script/daemon.py src/
echo "Creating SFX..."
tar -czf - * | pysfx -as "python install.py" - ../pylsa_sfx.py
echo "Removing copied files..."
rm -rf src
cd ..

View file

@ -86,7 +86,7 @@ def add_user(uname):
grp.seek(0, 2)
setuplib.create_directory("/home/%s" % uname, True, new_uid, new_gid, "u+rwx g+rx")
passwd.write("%s::%d:%d::/home/cvm:/bin/false\n" % (uname, new_uid, new_gid))
passwd.write("%s::%d:%d::/home/pylsa:/bin/false\n" % (uname, new_uid, new_gid))
grp.write("%s::%d:\n" % (uname, new_gid))
# We're done with /etc/passwd and /etc/group

View file

@ -15,7 +15,7 @@ bind_ip = ""
port = 8081
def generate_stats(get_processes):
listed_filesystems = ["ext2", "ext3", "ext4", "reiserfs", "removable", "fixed", "simfs"]
listed_filesystems = ["ext2", "ext3", "ext4", "reiserfs", "removable", "fixed", "simfs", "xfs"]
mem = psutil.virtual_memory()
swap = psutil.swap_memory()
@ -33,8 +33,10 @@ def generate_stats(get_processes):
"free": usage.free
}
uptime = (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME))
return_data = {
"uptime": (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).total_seconds(),
"uptime": (uptime.microseconds + (uptime.seconds + uptime.days * 24 * 3600) * 10**6) / 10**6,
"memory": {
"total": mem.total,
"available": mem.available,
@ -49,7 +51,8 @@ def generate_stats(get_processes):
"out": swap.sout
},
"disk": disks,
"cpu": psutil.cpu_percent(percpu=True)
"cpu": psutil.cpu_percent(percpu=True),
"load": list(os.getloadavg())
}
if get_processes: