Ad Widget

Collapse

Custom Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zibbax
    Junior Member
    • Nov 2008
    • 11

    #1

    Custom Reports

    Is there a guide on creating custom reports? I made a copy of report5.php and modified the sql query, and updated the db fields the loop looked for to populate the table data, however whenever I try to display the page I get an error:

    ERROR: No permissions!

    This is being done by the admin user (Super Administrator).

    Here is the code snippet.

    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_RE AD_ONLY,PERM_RES_IDS_ARRAY);
    $sql = "select * from hosts where dns not like 'mydomain.com' and host not like 'Template'";

    $result=DBselect($sql, 100);
    val_dump ($result);
    while($row=DBfetch($result)){
    if(!check_right_on_trigger_by_triggerid(null, $row['hostid'], $available_hosts))
    continue;

    $table->addRow(array(
    get_node_name_by_elid($row['hostid']),
    $row["host"],
    expand_trigger_description_by_data($row),
    new CCol(get_severity_description($row["dns"]),get_severity_style($row["dns"])),
    $row["useip"],
    ));
    }
    $table->show();
  • zibbax
    Junior Member
    • Nov 2008
    • 11

    #2
    I was able to get this going. The page_header.php needs an array value for this group or it won't work.

    Hooray reverse engineering code!



    Perhaps when I get better at this I'll make up a dev cookbook for customizations.

    Now if I could only get SNMP working.

    Comment

    Working...