Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
this is a pc Monitor program which can be used to report the start info through email and you can shutdown your pc by reply the report-mail
Python Shell
Branch: master

change

change
latest commit 8275b4c4c5
yanghua1127@gmail.com authored
Failed to load latest commit information.
.DS_Store first version
com.yanghua.pcMonitorService.plist first version
pcMonitor.py change
pcMonitorService.sh first version
readme.md change readme

readme.md

Usage

three documents:

(1)com.yanghua.pcMonitorService.plist

if you want to receive [pc start] msg, put the file into /Library/LaunchDaemons/. other way,to put this file into /Library/LaunchAgents so that you can receive the msg to kown someone has logined into your system.

(2)pcMonitorService.sh

put the shell script file into /usr/local/, and give other user execute permission in the terminal with below cmd: sudo chmod o+x /usr/local/pcMonitorService.sh

(3)pcMonitor.py

it's the program logic that will be executed actually. like pcMonitorService.sh, you should put this gay into /usr/local/. and you should modify somewhere which I havd marked as "#TODO", mostly they are about the e-mail.

ok,now you should give the user which you want monitor more permission, such as, shutdown. yeah, shutdown! I konw it seems to be very dangerous, but you must do that, if you want it looks like fascinating! first,modified shutdown shell sudo vi /sbin/shutdown then change the line contain: %users localhost=/sbin/shutdown -h now to (remove the first sharp symbol): %yanghua localhost=/sbin/shutdown -h now notice:yanghua is just my pc's user name

set the suid for the user of the pc that you want to monitor in the Treminal: sudo chmod u+s /sbin/shutdown

Modify info

added screen shot when the network is unable and handled method:"init" exception at Fri Feb 8.

More info

more information, please go and see my blog: http://blog.csdn.net/yanghua_kobe/article/details/8576106

and if you have any problem, give me your mail: yanghua1127@gmail.com

Have fun!

Something went wrong with that request. Please try again.