Watch4net APG 5: Script that pushed data to APG Backend is not working
search cancel

Watch4net APG 5: Script that pushed data to APG Backend is not working

book

Article ID: 304644

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:




Script that pushed data to Watch4net APG 5 Backend is not working

Script that pushed data to APG Backend returns this error message in the cache log:

WARNING -- [2007-03-03 15:10:10 PST] -- Cache::addData(): dropping invalid raw value.



Environment

VMware Smart Assurance - Watch4Net/M&R

Resolution

If you encounter this issue in your environment, do the following:

Verify the syntax of the data string you are sending to APG (if you are not using the APG Java Collector API). Make sure it has the following syntax:

\t<unix_time>\t<group>\t<variable>\t<value>\t<property1>=<value1>\t<property_n>=<value_n>

Example:
\t915148798\texternal\tCPU_cpu1_MyWindowsServer\t8.0\tsource=Nagios\tpartty pe=Processor\tpart=cpu1\tdevice=MyWindowsServer\tname=CurrentUtilization\tde vtype=Host\tdevdesc=Windows\tmodel=Dell\tlocation=EMEA\tip=10.128.2.22\tcontact=Admin\tunit=%

Note that the timestamp is in Unix time format. The value cannot be left empty. A value must absolutely be set or else the raw value will generate an exception. The following string will fail:

\t915148798\texternal\tCPU_cpu1_MyWindowsServer\tsource=Nagios\tpartty pe=Processor\tpart=cpu1\tdevice=MyWindowsServer\tname=CurrentUtilization\tde vtype=Host\tdevdesc=Windows\tmodel=Dell\tlocation=EMEA\tip=10.128.2.22\tcontact=Admin\tunit=%

Before sending a raw value, you will need to test if you actually have a value to send. If not, you can set the timestamp to -1. In that case, only the properties in the raw value will be processed. Also, you can simply omit to send the data string. APG will consider this as if there was no data available for that period (blank spot in the reports).

Make sure the group you are using is defined in the APG configuration file. If not, you need to edit config.xml located in <APG installation dir>/APG-Backend/conf. Locate the node "groups". Add a "group" element corresponding to the one in the raw value you are pushing as in the following example

Example config.xml:

<group name="external">
     <!-- For each aggregate defined in the aggregates configuration file mentionned below, there should be one element here describing the span-time retention to use. The name attribute only stands here as an ID that references the aggregate defined in the aggregate definition file. -->
    <raw>
        <!-- 1 month retention -->
        <span-time>2678400</span-time>
    </raw> <aggregate name="10min">
         <!-- 1 month duration -->
         <span-time>2678400</span-time>
    </aggregate> <aggregate name="30min">
        <!-- 1 month duration -->
        <span-time>2678400</span-time>
    </aggregate>
    <aggregate name="1hour">
        <!-- 2 months duration -->
        <span-time>5356800</span-time> </aggregate>
    <aggregate name="2hours">
        <!-- 2 months duration -->
        <span-time>5356800</span-time>
    </aggregate> <aggregate name="1day">
         <!-- 1 year duration -->
         <span-time>31536000</span-time> 
    </aggregate> 
    <aggregate name="1week">
         <!-- 7 years duration -->
         <span-time>220752000</span-time>
    </aggregate>
</group>