Server - Monitoring Tools

Server - Monitoring Tools

You can monitor contents, hit rate, etc of APCu using this

Developer’s Cookie is a cookie named etaktiker-dev-workstation and it should have a value of yes or debug.

set / set for debugging / unset (clear)

Memcached Admin APCu Monitor OPcache Status phpinfo() page

Google Pagespeed monitoring () http://examle.com/pagespeed_admin/cache?purge=*

Monitoring memcached

Monitoring memcached

phpMemcachedAdmin

phpmemcacheadmin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cd /var/www/vhosts/save-up.ch/httpdocs/systools/

mkdir -p memcacheadmin
cd memcacheadmin
wget http://phpmemcacheadmin.googlecode.com/files/phpMemcachedAdmin-1.2.2-r262.tar.gz --output-document=phpmemcacheadmin.tar.gz
tar xzf phpmemcacheadmin.tar.gz
rm phpmemcacheadmin.tar.gz
cd ..

chown --reference=. -R memcacheadmin
chmod -R 755 memcacheadmin
memcache-top

Simple command line utility:

# wget http://memcache-top.googlecode.com/files/memcache-top-v0.6 --output-document=memcache-top
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/memcache-top/memcache-top-v0.6 --output-document=memcache-top
chmod +x memcache-top
./memcache-top

You can also use something like this:

apt-get install netcat
watch "(echo stats ; echo quit ) | nc 127.0.0.1 11211"
Others

andrefigueira/memcache-monitor bainternet/Memchaced-Dashboard Unknown shitty project: lagged/memcache.php

Monitoring APCu

1
2
3
4
5
6
7
8
9
cd /var/www/vhosts/save-up.ch/httpdocs/systools/
wget https://github.com/krakjoe/apcu/raw/simplify/apc.php  --output-document=apcu.php
chown --reference=. -R apcu.php
chmod 644 apcu.php

# set admin
sed -i -re "s/^(defaults\('ADMIN_USERNAME',')([^']+)('\);)/\1etaktiker\3/gi" apcu.php
sed -i -re "s/^(defaults\('ADMIN_PASSWORD',')([^']+)('\);)/\1etaktiker\3/gi" apcu.php

Monitor Zend opCache

My Favorite Zend OPcache Status Scripts

rlerdorf/opcache-status

1
2
3
4
cd /var/www/vhosts/save-up.ch/httpdocs/systools/
wget https://raw.github.com/rlerdorf/opcache-status/master/opcache.php  --output-document=opcache.php
chown --reference=. -R opcache.php
chmod 644 opcache.php

Monitor PHP

Simple phpinfo() page:

echo "<?php phpinfo(); ?>" >/var/www/vhosts/save-up.ch/httpdocs/systools/phpinfo.php

Nginx: Enable PHP-FPM Status Page


Username: etaktiker / etaktikerpassword.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cat <<'EOF' > /var/www/vhosts/save-up.ch/httpdocs/systools/.credentials
# you can use any online .htpasswd generator
etaktiker:$apr1$iNb3.lhp$s6jLJbVTGWrPfdlFItQqa.
EOF

cat <<'EOF' > /var/www/vhosts/save-up.ch/conf.d/systools.conf

# get the cookie value
set $devcookie "no";
if ($http_cookie ~* "etaktiker-dev-workstation=([a-z0-9]+)(?:/|$)") {
  set $devcookie $1;
}

# simulating `or`
set $protect "Restricted System Tools Area";
if ($devcookie = "yes"  ) { set $protect "off"; }
if ($devcookie = "debug") { set $protect "off"; }

location /systools {

  location ~ \.php(/.*)?$ {

    auth_basic $protect;
    auth_basic_user_file $document_root/systools/.credentials;

    fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass "unix:/var/www/vhosts/system/save-up.ch/php-fpm.sock";
    include /etc/nginx/fastcgi.conf;
  }

  # hide files beginning with dot
  location ~ /\. {
    deny all;
  }

  # static files
  location ~ {
    auth_basic $protect;
    auth_basic_user_file $document_root/systools/.credentials;
    try_files $uri =404;
  }
}
EOF

As needed, we can test and simulate cookies with curl:

    curl --cookie "etaktiker-dev-workstation=yes" -I http://www.save-up.ch/systools/devcookie.php
date 01. Jan 0001 | modified 28. May 2021
filename: Server - Monitoring