monitoring

Get heap dump from a remote application in Java using JVisualVM

最后都变了- 提交于 2019-11-28 05:07:47
I run JVisualVM (Windows XP, Sun Java 1.6.0.13, 32 bit client VM) to monitor a distant application (Linux, Sun Java 1.6.0.07, 64 bit server VM). Before starting the actual remote application, I launch on the remote machine jstatd using an all access policy: grant codebase "file:${java.home}/../lib/tools.jar" { permission java.security.AllPermission; }; Then I start the actual app using the command line java -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=3333 compileTest.Main From the client machine, I can see the

PowerShell script to check the status of a URL

ぃ、小莉子 提交于 2019-11-28 05:02:54
Similar to this question here I am trying to monitor if a set of website links are up and running or not responding. I have found the same PowerShell script over the Internet. However, instead of direct website links I need to check more specific links, for example: http://mypage.global/Chemical/ http://maypage2:9080/portal/site/hotpot/ When I am trying to check on the status of these links, I get the following output: URL StatusCode StatusDescription ResponseLength TimeTaken http://mypage.global/Chemical/ 0 http://maypage2:9080/portal/site/hotpot/ 0 The above links requires me to be connected

How to monitor Windows services [closed]

杀马特。学长 韩版系。学妹 提交于 2019-11-28 04:52:50
I'm looking for a way to monitor certain Windows services (on Windows Server 2003) and restart if necessar y. The services are on different servers and include mainly SQL Server services (e.g. SQL Server Agent), but also some proprietary services. Email alerts sent out if a service has stopped would be very useful as well. A "might be enough" version of this is built into Windows. Look into the "Recovery" tab of the service properties, as available via services.msc . You can act on a service fail with: "Restart the Service" "Run a Progam" "Restart the Computer" "Run a program" could be a small

Tool to monitor HTTP, TCP, etc. Web Service traffic [closed]

女生的网名这么多〃 提交于 2019-11-28 04:29:26
What's the best tool that you use to monitor Web Service, SOAP, WCF, etc. traffic that's coming and going on the wire? I have seen some tools that made with Java but they seem to be a little crappy. What I want is a tool that sits in the middle as a proxy and does port redirection (which should have configurable listen/redirect ports). Are there any tools work on Windows to do this? For Windows HTTP, you can't beat Fiddler . You can use it as a reverse proxy for port-forwarding on a web server. It doesn't necessarily need IE, either. It can use other clients . Wireshark does not do port

python watchdog monitoring file for changes

独自空忆成欢 提交于 2019-11-28 03:04:25
Folks, I have a need to watch a log file for changes. After looking through stackoverflow questions, I see people recommending 'watchdog'. So i'm trying to test, and am not sure where to add the code for when files change: #!/usr/bin/python import time from watchdog.observers import Observer from watchdog.events import LoggingEventHandler if __name__ == "__main__": event_handler = LoggingEventHandler() observer = Observer() observer.schedule(event_handler, path='.', recursive=False) observer.start() try: while True: time.sleep(1) else: print "got it" except KeyboardInterrupt: observer.stop()

Monitor directory for new files only

泄露秘密 提交于 2019-11-28 01:53:27
问题 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 );

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

回眸只為那壹抹淺笑 提交于 2019-11-28 01:49:42
问题 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. 回答1: Try this: public static DateTime? GetLastLogin(string domainName,string userName) { PrincipalContext c = new PrincipalContext(ContextType.Domain,domainName); UserPrincipal uc =

Monitoring CPU and disk utilization of a single program

蓝咒 提交于 2019-11-28 01:14:35
问题 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. 回答1: 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

Can jconsole data be retrieved from the command line?

ⅰ亾dé卋堺 提交于 2019-11-27 21:51:30
I am currently using jconsole to monitor performance metrics of my Java application and would like to script this data acquisition . Is there a way to retrieve these VM metrics (heap memory usage, thread count, CPU usage etc.) to STDOUT ? The data in top -p PID -b -n 1 doesn't quite cut it. Thanks jconsole just provides a wrapper around the JMX MBeans that are in the platform MBeanServer. You can write a program to connect to your VM using the Attach API which would then query the MBeans. Or you can expose the platform MBeanServer over RMI and query the MBeans that way. See the java.lang

How to check if a php script is still running

可紊 提交于 2019-11-27 21:40:31
I have a PHP script that listens on a queue. Theoretically, it's never supposed to die. Is there something to check if it's still running? Something like Ruby's God ( http://god.rubyforge.org/ ) for PHP ? God is language agnostic but it would be nice to have a solution that works on windows as well. Jay I had the same issue - wanting to check if a script is running. So I came up with this and I run it as a cron job. It grabs the running processes as an array and cycles though each line and checks for the file name. Seems to work fine. Replace #user# with your script user. exec("ps -U #user# -u