Project

General

Profile

Revision 0e0753c8

ID0e0753c8cfad3350b7b0215005ebb1bcf41cf7d6
Parent a5c9df40
Child b204adb9

Added by Romain Chollet over 7 years ago

Correction d'un bug d'affichage, ajout des faux tests logiciels

Dans glpi, une interruption avait lieu lors du déploiement de la
configuration vigilo. La cause de l'erreur était un reload de httpd
fait par vigilo. Cela a été résolu en faisant un script httpd dans
le dossier de configuration de vigilo.
L'ajout des faux logiciels nécessite encore des modifications qui
vont apparaître dans un prochain commit.

Change-Id: I434d4287526137b46387bf6377ceff7ddfd03de2

View differences:

Vigilo/VigiloTestSoftware.php
24 24

  
25 25
    public function addRelevantTestWith($softwareName)
26 26
    {
27
        $functionArray=$this->softwareBase[$softwareName];
27
	if (substr($softwareName, 0, 20) === "vigilo-test-process-") 
28
	{
29
	    $functionArray=array("addCustomTest", array($softwareName));
30
	}
31
	else 
32
	{
33
            $functionArray=$this->softwareBase[$softwareName];
34
	}
28 35
        $this->testTable[]=call_user_func_array(array($this,$functionArray[0]), $functionArray[1]);
29 36
    }
30 37

  
38
    protected function addCustomTest($softwareName)
39
    {
40
        return new VigiloTest(substr($softwareName, 20));	
41
    }
42

  
31 43
    protected function addNTPTest()
32 44
    {
33
        //TODO : set up arguments
34
        $args=array();
45
	$args=array();
35 46
        //$address=0;
36 47
        //$args[]=new VigiloArg('address',$address);
37 48
        $args[]=new VigiloArg('crit', 0);
......
41 52

  
42 53
    protected function addNTPqTest()
43 54
    {
44
        //TODO: set up arguments
45 55
        $args=array();
46
        $args[]=new VigiloArg('crit', 0);
47
        $args[]=new VigiloArg('warn', 0);
56
        $args[]=new VigiloArg('crit', 2000);
57
        $args[]=new VigiloArg('warn', 5000);
48 58
        return new VigiloTest('NTPq', $args);
49 59
    }
50 60

  
51
    protected function addNTPSyncTest()
61
    protected function addNTPSyncTest() // OK
52 62
    {
53 63
        return new VigiloTest('NTPSync');
54 64
    }
55 65

  
56
    protected function addHTTPTest()
66
    protected function addHTTPTest() // OK
57 67
    {
58 68
        return new VigiloTest('HTTP');
59 69
    }
......
61 71
    protected function addMemcachedTest($computer)
62 72
    {
63 73
        $args=array();
64
        $args[]=new VigiloArg('port', 11211);//TODO: set up arguments
74
        $args[]=new VigiloArg('port', 11211);
65 75
        return new VigiloTest('Memcached', $args);
66 76
    }
67 77

  
......
72 82

  
73 83
    protected function addPGSQLTest($computer)
74 84
    {
75
        //TODO: set up arguments
76
        //$args=array();
77
        //$args[]=new VigiloArg('database',NULL);
78
        //$args[]=new VigiloArg('port',NULL);
79
        //$args[]=new VigiloArg('user',NULL);
80
        //return new VigiloTest('PostgreSQLConnection',$args);
85
        $args=array();
86
        $args[]=new VigiloArg('database',"postgres");
87
        $args[]=new VigiloArg('port',5432);
88
        $args[]=new VigiloArg('user',"postgres");
89
        return new VigiloTest('PostgreSQLConnection',$args);
81 90
    }
82 91

  
83 92
    protected function addProxyTest()
84 93
    {
85
        //TODO: set up arguments
86
        //$args=array();
87
        /*$args[]=new VigiloArg('auth',NULL);
88
        $args[]=new VigiloArg('port',NULL);
89
        $args[]=new VigiloArg('url',NULL);*/
90
        //return new VigiloTest('Proxy',$args);
94
        $args=array();
95
        $args[]=new VigiloArg('auth',"False");
96
        $args[]=new VigiloArg('port',8080);
97
        $args[]=new VigiloArg('url',"http://www.google.fr");
98
        return new VigiloTest('Proxy',$args);
91 99
    }
92 100

  
93 101
    protected function addRRDcachedTest($computer)
94 102
    {
95
        //TODO: set up arguments
96
        //$path=
97
        //$args=array();
98
        //$args[]=new VigiloArg('crit',0);
99
        //$args[]=new VigiloArg('path',$path);
100
        //$args[]=new VigiloArg('warn',0);
101
        //return new VigiloTest('RRDcached',$args);
103
        $path="/var/lib/vigilo/connector-metro/rrdcached.sock";
104
        $args=array();
105
        $args[]=new VigiloArg('crit',0);
106
        $args[]=new VigiloArg('path',$path);
107
        $args[]=new VigiloArg('warn',0);
108
        return new VigiloTest('RRDcached',$args);
102 109
    }
103 110

  
104 111
    protected function addSSHTest()
......
115 122

  
116 123
    protected function addVigiloCorrelatorTest()
117 124
    {
118
        //TODO :set up arguments
119
        //$args=array();
120
        //$args[]=new VigiloArg('rules',NULL);
121
        //$args[]=new VigiloArg('servicename',NULL);
122
        //return new VigiloTest('VigiloCorrelator',$args);
125
        $args=array();
126
        //$args[]=new VigiloArg('rules','');
127
        $args[]=new VigiloArg('servicename','vigilo-correlator');
128
        return new VigiloTest('VigiloCorrelator',$args);
123 129
    }
124 130

  
125
    protected function TestService($computer)
131
    protected function TestService($computer, $service)
126 132
    {
127
        //TODO: set up arguments
128
        //$args=array();
129
        //$args[]=new VigiloArg('svcname',NULL);
130
        //return new VigiloTest('Service',$args);
133
        $args=array();
134
        $args[]=new VigiloArg('svcname',$service);
135
        return new VigiloTest('Service',$args);
131 136
    }
132 137

  
133 138
    public function __toString()

Also available in: Unified diff