monitoring

How to monitor free disk space at AWS EC2 with Cloud Watch in windows

僤鯓⒐⒋嵵緔 提交于 2019-11-29 13:39:58
问题 I want to make alarm in case that there is 10% left in my disk space. I read some articles of how monitoring free disk space with Cloud Watch but I think it seems to be only for linux. Do you have any solution for monitoring free disk space for windows? Thanks in advance. 回答1: This is how to configure a Windows 2016 EC2 instance to report free disk space (or any other performance counter on your server) Download a sample AWS.EC2.Windows.CloudWatch.json file. This is where I found one. https:/

How to constanly monitor LogCat file?

[亡魂溺海] 提交于 2019-11-29 10:47:18
问题 I need to somehow monitor the LogCat log, meaning that while my service is running I need to read the LogCat for new entries. At this moment I know only how to retrieve once the Log: Process mLogcatProc = null; BufferedReader reader = null; try { mLogcatProc = Runtime.getRuntime().exec(new String[] {"logcat", "-d", "ActivityManager:I *:S" }); reader = new BufferedReader(new InputStreamReader (mLogcatProc.getInputStream())); String line; final StringBuilder log = new StringBuilder(); String

How can I monitor the rendering time in a browser?

时光怂恿深爱的人放手 提交于 2019-11-29 10:24:48
I work on an internal corporate system that has a web front-end using Tomcat. How can I monitor the rendering time of specific pages in a browser (IE6)? I would like to be able to record the results in a log file (separate log file or the Tomcat access log). EDIT: Ideally, I need to monitor the rendering on the clients accessing the pages. Vlad Gudim In case a browser has JavaScript enabled one of the things you could do is to write an inline script and send it first thing in your HTML. The script would do two things: Record current system time in a JS variable (if you're lucky the time could

Monitor directory for new files only

喜欢而已 提交于 2019-11-29 08:46:04
I'd like to monitor a directory for new files from a C app. However, I'm not interested in modified files, only in new files. Currently I'm using readdir/stat for that purpose: while ( (ent = readdir(dir)) != NULL ) { strcpy(path, mon_dir); strcat(path, "/"); strcat(path, ent->d_name); if ( stat(path, &statbuf) == -1 ) { printf( "Can't stat %s\n", ent->d_name ); continue; } if ( S_ISREG(statbuf.st_mode) ) { if ( statbuf.st_mtime > *timestamp ) { tcomp = localtime( &statbuf.st_mtime ); strftime( s_date, sizeof(s_date), "%Y%m%d %H:%M:%S", tcomp ); printf( "%s %s was added\n", s_date, ent->d_name

Checking the status of a phone call remotely

感情迁移 提交于 2019-11-29 08:30:53
I want to check after starting a phone call what the status of the call is via a connected PC, if possible with the ADB. I'm starting a call by entering a phone number with the adb command service call phone 2 s16 "some phone number" and then sending input keyevent 5 to press the call button. Now I'm struggeling to find a way to determine the status of the call. I need to know if the the number getting called is currently busy, if the call got cancelled or if the call was successfull/that I have an open voice connection to the called number. Is there any way of monitoring that? The phone model

How to programatically find out the last login time to a machine?

不羁岁月 提交于 2019-11-29 08:06:15
I would like to a) programatically and b) remotely find out the last date/time that a user successfully logged into a Windows machine (via remote desktop or at the console). I would be willing to take any typical windows language (C, C#, VB, batch files, JScript, etc...) but any solution would be nice. Try this: public static DateTime? GetLastLogin(string domainName,string userName) { PrincipalContext c = new PrincipalContext(ContextType.Domain,domainName); UserPrincipal uc = UserPrincipal.FindByIdentity(c, userName); return uc.LastLogon; } You will need to add references to using using System

Monitoring CPU and disk utilization of a single program

旧时模样 提交于 2019-11-29 07:41:37
How can I calculate CPU and disk utilization of another concurrent program? I.e. one program is running and other calculates the first's resource use. I'm using C and C++ and running under Windows XP. As for CPU utilization it is not difficult to do after taking a look at this link Windows C++ Get CPU and Memory Utilisation With Performance Counters . As far as I understand (but have not tested) it is also possible to find out disk utilization. The idea is to use Performance Counters . In your situation you need to use the performance counter L"\\Process(program_you_are_interested_in_name)\\%

Perfmon-like for Linux?

自闭症网瘾萝莉.ら 提交于 2019-11-29 06:31:17
问题 In windows there is perfmon to monitor various performances aspects (called counters ) of the system. Is there a perfmon-like for Linux? especially, in interested in... CPU usage (total/per process/in kernel) Memory usage (total/per process/in kernel) ...Is it possible to store this information in files for future analysis? 回答1: The program "top" does most of this. It does not handle network traffic though. Edit: If you need to log this information for post processing/analysis you can use the

SSH.NET real-time command output monitoring

陌路散爱 提交于 2019-11-29 05:12:42
There is a long running script script.sh on a remote Linux machine. I need to start it and monitor it's activity in real time. The script during it's activity may output to stdout and stderr . I am searching for a way to capture both of the streams. I use Renci SSH.NET to upload script.sh and start it, so it would be great to see a solution bounded to this library. In my mind the perfect solution is the new method: var realTimeScreen= ...; var commandExecutionStatus = sshClient.RunCommandAsync( command: './script.sh', stdoutEventHandler: stdoutString => realTimeScreen.UpdateStdout(stdString)

Android: programmatically determine list of apps that have a TCP connection open

血红的双手。 提交于 2019-11-29 05:11:34
I would like know which applications on my android connect to what IP addresses. In essence I would like to know what these apps do in the background without my approval. I tried a netstat OS call in my monitoring app, which already gives me the open connections and the connected IP addresses, but there is no process name, pid or uid that would allow me to map a connection to a particular app. 'netstat -p' seems not to provide the process info. eolwral If you read source code for 'netstat', it actually reads data from /proc/net/tcp which holds a dump of the TCP socket table, the data will like