Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 5:42 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: network card query
PostPosted: Mon Mar 26, 2007 10:29 am 
Offline
Newbie

Joined: Sat Mar 17, 2007 5:20 am
Posts: 8
Location: RI, USA
I wrote this while tring to learn how Open-Audit works and thought someone else might find it useful.
I did have two problems, anyone see an error on the code or is it the database. One of the network devices has a blank name and card shows 13 hosts on the summary page but only 12 on the systems page.


list_viewdef_systems_for_netcard.php
[code]
<?php

$query_array=array("headline"=>__("List Systems with Network Card Type"),
"sql"=>"SELECT * FROM system, network_card
WHERE net_uuid = system_uuid
AND system_timestamp = net_timestamp
AND net_description = '" . $_GET["net_description"] . "' ",
"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"=>"system_name",
"head"=>__("Hostname"),
"show"=>"y",
"link"=>"y",
),
"30"=>array("name"=>"net_ip_address",
"head"=>__("IP"),
"show"=>"y",
"link"=>"n",
),
"40"=>array("name"=>"system_model",
"head"=>__("Brand/Model"),
"show"=>"y",
"link"=>"n",
),
),
);
?>
[/code]

list_viewdef_statistic_netcards.php
[code]
<?php

$query_array=array("headline"=>__("Statistic for Network Card Versions"),
"sql"=>"SELECT
net_description,
net_description AS full_net_card_name,
COUNT( net_uuid ) AS count_item,
round( 100 / (SELECT count(net_uuid)
FROM network_card
WHERE net_description != '') * COUNT( net_uuid ), $round_to_decimal_places )
AS percentage
FROM network_card
WHERE (1)
GROUP BY net_description",
"sort"=>"count_item",
"dir"=>"DESC",
"get"=>array("file"=>"list.php",
"title"=>__("Systems installed this network card type"),
"var"=>array("net_description"=>"%full_net_card_name",
"view"=>"systems_for_netcard",
"headline_addition"=>"%full_net_card_name",
),
),
"fields"=>array("10"=>array("name"=>"net_description",
"head"=>__("Type"),
"show"=>"y",
"link"=>"y",
),
"20"=>array("name"=>"count_item",
"head"=>__("Count"),
"show"=>"y",
"link"=>"n",
"search"=>"n",
),
"30"=>array("name"=>"percentage",
"head"=>__("Percentage"),
"show"=>"y",
"link"=>"n",
"search"=>"n",
),
),
);
?>
[/code]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group