ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/graphs/graphs_config.inc.php
Revision: 1.4
Committed: Mon Mar 10 21:17:41 2003 UTC (21 years, 7 months ago) by tdb
Branch: MAIN
Changes since 1.3: +10 -0 lines
Log Message:
Update the web pages to deal with the new data.

File Contents

# User Rev Content
1 tdb 1.1 <?
2    
3     # The rrd directory containing the images
4     $imgdir = "/home/pkg/iscream/public_html/graphs";
5 tdb 1.3 $imgwebdir = "/graphs";
6 tdb 1.1
7     # Page appearance
8     $lineColor = "#9999ff";
9    
10     # tidy up the visual names
11     function tidyName($machine_name, $string) {
12     # The name CPU information should be displayed as
13     if($string == "cpu") {
14     return "Processor usage";
15     }
16    
17     # The name Load information should be displayed as
18     if($string == "load") {
19     return "System loads";
20     }
21    
22     # The name Memory information should be displayed as
23     if($string == "mem") {
24     return "Memory usage";
25     }
26    
27     # The name Process information should be displayed as
28     if($string == "proc") {
29     return "Processes";
30     }
31    
32     # The name Swap information should be displayed as
33     if($string == "swap") {
34     return "Swap usage";
35     }
36    
37     # The name User information should be displayed as
38     if($string == "users") {
39     return "User counts";
40     }
41 tdb 1.3
42     # The name Paging information should be displayed as
43     if($string == "paging") {
44     return "Paging";
45     }
46    
47 tdb 1.1 # Values use for escaping (need to match the perl scripts!)
48     # / converted to a decimal then hex'd
49     $hex_slash = "_2f";
50     # _ converted to a decimal then hex'd
51     $hex_underscore = "_5f";
52    
53     # The name Disk information should be displayed as
54     if(preg_match("/^disk-(\S+)$/", $string, $matches)) {
55     $string = preg_replace("/$hex_slash/", "/", $matches[1]);
56 tdb 1.2 $string = preg_replace("/$hex_underscore/", "_", $string);
57 tdb 1.1 return "Disk usage: $string";
58     }
59 tdb 1.4
60     # The name DiskIO information should be displayed as
61     if(preg_match("/^diskio-(\S+)$/", $string, $matches)) {
62     return "Disk IO: $matches[1]";
63     }
64    
65     # The name Network information should be displayed as
66     if(preg_match("/^net-(\S+)$/", $string, $matches)) {
67     return "Network usage: $matches[1]";
68     }
69 tdb 1.1
70     # The name Queue information should be displayed as
71     if($machine_name == "i-scream-server" && preg_match("/^\d+$/", $string)) {
72     $readfile = file("/u1/i-scream/databases/$machine_name/$string.def");
73     return "Queue: $readfile[0]";
74     }
75    
76     # Catch all... don't change it
77     return "$string";
78     }
79    
80     # Files to include
81     $titleHTML = "title.inc.php";
82     $bottomHTML = "bottom.inc";
83    
84     # Submission details.
85     $formMethod = "GET";
86     $thisPage = "graphs.php";
87    
88     ?>