Question

What is the most reliable way to monitor OACI stability and availability? It should be suitable for automatic monitoring via shell scripts, cron or more complicated systems.

Answer

OACI provides reliable and stable API for OA and administrator's needs. Overview of its main concepts and detailed description of methods are covered in OACI RESTful API guide.

For internal monitoring it is possible to acquire some persistent data from OACI API. Rule of thumb for all examples below is: if there is no answer or curl returns anything, except XML-formatted message, OACI IM service requires attention.

OACI REST interface requires credentials to authorize incoming requests. In order to acquire login and password for OACI API, please launch OACI_passwd.py script on Odin Automation management node. Take credentials from output of the script, acquire OACI IM host IP address and pass these data to curl like below:

# curl -u 'user:password' http://IM_HOST_ADDRESS:4465/paci/v1.0/vm2vf

The following examples are the most effective way to monitor OACI availability. These checks should be launched on Odin Automation management node.

  1. Check pending callbacks from vm2vf process. This will reveal operations that are sent to Virtuozzo nodes like provisioning requests, any operations with Virtual Environments and statistics gathering. Example of request and an answer:

    # curl -u 'user:password' http://IM_HOST_ADDRESS:4465/paci/v1.0/vm2vf
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <pending-callbacks/>
    
  2. Check provider's subscription. It always exists, so output should be similar to:

    # curl -u 'user:password' http://IM_HOST_ADDRESS:4465/paci/v1.0/of/1/subscription
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <subscriptions>
        <subscription id="1" customer-id="1" used-public-ip="8" used-public-ipv6="0"/>
    </subscriptions>
    
  3. Check provider's (or any customer's) registered virtual environments. Number between /of and /ve is customer ID. Swap it to valid customer ID to check his or her linked VEs:

    # curl -u 'user:password' http://IM_HOST_ADDRESS:4465/paci/v1.0/of/1/ve
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ve-list>
        <ve-info state="STOPPED" name="example" subscription-id="1" custom-ns="true" id="726" hostname="example.provider.local"/>
    </ve-list>
    

Any of these tests could be used with equal effectiveness, output could be parsed and tested further automatically. Since these tests are basic curl requests, they can be used in any scripts or added to cron.

Internal content