Posts

Showing posts with the label server

Hack : Monitoring CPU usage from Your Mobile

Image
Background Sometimes I need to run a long-running background process in the server, and I need to know when does the CPU usage returns to (almost) 0, indicating the process finished. I know there are other options, like sending myself an email when the process finished, but currently I am satisfied with monitoring the CPU usage. The old way I have an android cellphone, which allows me to : Launch ConnectBot, type ssh username and password connect to the server type top watch the top result The new way Because I am more familiar with PHP than with anything else right now (ok, there are times I am more familiar with C Sharp, but it is another story), I  do a quick google search for 'php cpu usage' and found  http://stackoverflow.com/questions/13131003/get-cpu-percent-usage-in-php . Using stix's solution I created this simple JSON web service using PHP : For displaying the CPU as a graph, another google search pointed me to Flot, a javascript l...

How to Peek inside your ActiveMQ Server

Image
This post describes steps that can be taken for sysadmins to peek inside an ActiveMQ server. We assume root capability, otherwise we need a user which has access to ActiveMQ configuration files. Step 1. Determine running ActiveMQ process ps auxw | grep activemq We got a java process running ActiveMQ : [root@broker ~]# ps auxw | grep activemq activemq  1236  0.1  0.0  19124   696 ?        Sl   07:00   0:02 /usr/lib/activemq/linux/wrapper /etc/activemq/wrapper.conf wrapper.syslog.ident=ActiveMQ wrapper.pidfile=/var/run/activemq//ActiveMQ.pid wrapper.daemonize=TRUE wrapper.lockfile=/var/lock/subsys/ActiveMQ activemq  1243  3.2 12.2 2016568 125264 ?      Sl   07:00   1:06 java -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/usr/share/activemq -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.keyStore=/usr/share/activemq/conf/broker.ks...

Learning Cloud Foundry - NATS

All Cloud Foundry components communicates with each other using NATS publish-subscribe mechanism. Lets see in detail what is NATS like. Cloud Foundry Router as NATS client During startup of Cloud Foundry Router ( router.rb ), there is a call to start NATS client below : NATS . start ( :uri => config [ 'mbus' ] ) It means that NATS client will be started with the uri parameter obtained from configuration parameter 'mbus'.  config_path = ENV [ "CLOUD_FOUNDRY_CONFIG_PATH" ] || File . join ( File . dirname ( __FILE__ ), '../config' ) config_file = File . join ( config_path , 'router.yml' ) ... opts . on ( "-c" , "--config [ARG]" , "Configuration File" ) do | opt |      config_file = opt    end ... We find that the configuration parameter will be read from a YAML (yet Another Markup Language) that whose location could came from multiple sources, in these order : specified fro...