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();
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();

Comment