<?php
$name = 'portactivity';
$app_id = $app['app_id'];
$unit_text     = 'Connections';
$colours       = 'psychedelic';
$dostack       = 0;
$printtotal    = 0;
$addarea       = 1;
$transparency  = 15;

$rrd_filename = rrd_name($device['hostname'], array('app', $name, $app['app_id'], $vars['port']));


$rrd_list=array();
if (rrdtool_check_rrd_exists($rrd_filename)) {
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'CLOSED',
        'ds'       => 'toCLOSED',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'SYN_SENT',
        'ds'       => 'toSYN_SENT',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'SYN_RECEIVED',
        'ds'       => 'toSYN_RECEIVED',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'ESTABLISHED',
        'ds'       => 'toESTABLISHED',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'CLOSE_WAIT',
        'ds'       => 'toCLOSE_WAIT',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'FIN_WAIT_1',
        'ds'       => 'toFIN_WAIT_1',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'CLOSING',
        'ds'       => 'toCLOSING',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'LAST_ACK',
        'ds'       => 'toLAST_ACK',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'FIN_WAIT_2',
        'ds'       => 'toFIN_WAIT_2',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'TIME_WAIT',
        'ds'       => 'toTIME_WAIT',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'UNKNOWN',
        'ds'       => 'toUNKNOWN',
    );
    $rrd_list[]=array(
        'filename' => $rrd_filename,
        'descr'    => 'other',
        'ds'       => 'toother',
    );
} else {
    d_echo('RRD "'.$rrd_filename.'" not found');
}

require 'includes/graphs/generic_multi_line.inc.php';
