src/main/java/org/jmxtrans/agent/zabbix/ZabbixMetricMessageBuilder.java
public String buildMessage(String metricName, Object value, long timestamp) {
        String valueToString = "null";
        if( value != null ) {
            valueToString = value.toString();
        }

        JsonObject jsonValue = new JsonObject();
        jsonValue.add("host", getHostName());
        jsonValue.add("key", metricName);
        jsonValue.add("value", valueToString);
        jsonValue.add("clock", timestamp);

        return jsonValue.toString();
    }
public String buildMessage(String metricName, Object value, long timestamp) {
        String valueToString = "null";
        if( value != null ) {
            valueToString = value.toString();
        }

        JsonObject jsonValue = new JsonObject();
        jsonValue.add("host", getHostName());
        jsonValue.add("key", metricName);
        jsonValue.add("value", valueToString);
        jsonValue.add("clock", timestamp);

        return jsonValue.toString();
    }
public String buildMessage ( String metricName , Object value , long timestamp ) { String valueToString = "null" ; if ( value != null ) { valueToString = value . toString ( ) ; } JsonObject jsonValue = new JsonObject ( ) ; jsonValue . add ( "host" , getHostName ( ) ) ; jsonValue . add ( "key" , metricName ) ; jsonValue . add ( "value" , valueToString ) ; jsonValue . add ( "clock" , timestamp ) ; return jsonValue . toString ( ) ; }
Builds a metric string to send to a Graphite instance.

@return The metric json string without trailing newline
Builds a metric string to send to a Graphite instance .