Open-AudIT
https://www.open-audit.org/phpBB3/

View all Domains/Workgroups
https://www.open-audit.org/phpBB3/viewtopic.php?f=9&t=2189
Page 1 of 1

Author:  JonB [ Mon Mar 12, 2007 7:01 am ]
Post subject:  View all Domains/Workgroups

I wanted an easy way to be able to group all domains/workgroups and group systems under those domains so I added a 'View all Domains/Wrkgrps' to the Queries list.

Code below.


list_viewdef_all_domains.php
[code]<?php

$query_array=array("headline"=>__("List all Domains/Workgroups"),
"sql"=>"SELECT count(net_domain) AS domain_count, net_domain
FROM system
GROUP BY net_domain",
"sort"=>"net_domain",
"dir"=>"ASC",
"get"=>array("file"=>"list.php",
"title"=>__("Hosts with this domain"),
"var"=>array("view"=>"systems_for_domains",
"name"=>"%net_domain",
"headline_addition"=>"%net_domain",
),
),
"fields"=>array("10"=>array("name"=>"domain_count",
"head"=>__("Count"),
"show"=>"y",
"link"=>"y",
),
"20"=>array("name"=>"net_domain",
"head"=>__("Domain/Workgroup"),
"show"=>"y",
"link"=>"y",
"sort"=>"y",
"search"=>"y",
),
),
);
?>
[/code]


list_viewdef_systems_for_domains.php
[code]<?php

$query_array=array("headline"=>__("List Systems with Domain/Workgroup"),
"sql"=>"SELECT * FROM system WHERE net_domain = '" . $_GET["name"] . "' ",
"sort"=>"system_name",
"dir"=>"ASC",
"get"=>array("file"=>"system.php",
"title"=>"Go to System",
"var"=>array("pc"=>"%system_uuid",
"view"=>"summary",
),
),
"fields"=>array("10"=>array("name"=>"system_uuid",
"head"=>__("UUID"),
"show"=>"n",
),
"20"=>array("name"=>"net_ip_address",
"head"=>__("IP"),
"show"=>"y",
"link"=>"y",
),
"30"=>array("name"=>"system_name",
"head"=>__("Hostname"),
"show"=>"y",
"link"=>"y",
),
),
);
?>
[/code]

Add the following line to the queries array in inc_menu_array.php. It can go wherever you like, just change the array number. In my case it is after 'View all servers'. Watch the line wrap.

[code]"45"=>array("name"=>"All Domains/Wrkgrps", "link"=>"./list.php?view=all_domains", "image"=>"images/computer.png", "title"=>"All Domains/Wrkgrps",),
[/code]

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/