summaryrefslogtreecommitdiffstats
path: root/doc/server/plugins/probes/vserver.txt
blob: f95390e997de777aa66a09845d4daca7262403aa (plain)
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
.. -*- mode: rst -*-

.. _server-plugins-probes-vserver:

vserver
=======

Detect if the server is a Linux-VServer host.

.. code-block:: sh

    #!/bin/sh

    # Test the proc
    TEST=`cat /proc/self/status|grep s_context| cut -d":" -f2|cut -d" " -f 2`

    case "$TEST" in
      "")
        # Not a vserver kernel
        echo group:host
        ;;
      "0")
        # Vserver kernel but it is the HOST
        echo group:host
        ;;
      [0-9]*)
        # Vserver
        echo group:vserver
        ;;
    esac