Project

General

Profile

Revision c60a37ae

IDc60a37aea7f8e4850850b4d56464b3cc662eed9c
Parent cdde5484
Child ad931b2e

Added by Francois POIROTTE about 7 years ago

Corrections pour la sup. des logiciels prédéfinis

Change-Id: I393c3ffc20c8ed01602b302e0fad88db45983a62
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2378
Tested-by: Build system <>
Reviewed-by: Francois POIROTTE <>

View differences:

src/plugins/vigilo/inc/monitoredcomputer.class.php
79 79

  
80 80
    protected function monitorSoftwares()
81 81
    {
82
        $computerSoftwareVersion = new Computer_SoftwareVersion();
83
        $ids = $computerSoftwareVersion->find('computers_id=' . $this->item->getID());
84
        foreach ($ids as $id) {
85
            if (!$id['softwareversions_id']) {
82
        $installations = new Computer_SoftwareVersion();
83
        $installations = $installations->find('computers_id=' . $this->item->getID());
84
        foreach ($installations as $installation) {
85
            if (!$installation['softwareversions_id']) {
86 86
                continue;
87 87
            }
88 88

  
89
            $softwareVersion = new SoftwareVersion();
90
            $ids2 = $softwareVersion->find('id=' . $id['softwareversions_id']);
91
            foreach ($ids2 as $id2) {
92
                if (!$id2['softwares_id']) {
89
            $versions = new SoftwareVersion();
90
            $versions = $versions->find('id=' . $installation['softwareversions_id']);
91
            foreach ($versions as $version) {
92
                if (!$version['softwares_id']) {
93 93
                    continue;
94 94
                }
95 95

  
96 96
                $software = new Software();
97
                $software->getFromDB($id2['softwares_id']);
98

  
97
                $software->getFromDB($version['softwares_id']);
99 98
                $lcname = strtolower($software->getName());
100 99
                if (isset(static::$softwares[$lcname])) {
101 100
                    // Gestion des logiciels supervisés automatiquement.
......
108 107
                        continue;
109 108
                    }
110 109

  
111
                    $type   = ucfirst(strtolower($parts[3]));
112
                    $args   = isset($parts[4]) ? $parts[4] : null;
110
                    $type   = ucfirst(strtolower($parts[2]));
111
                    $args   = isset($parts[3]) ? $parts[3] : null;
113 112
                    $method = 'monitorCustom' . $type;
114 113
                    if (method_exists($this, $method)) {
115 114
                        $this->$method($software, $args);
......
121 120

  
122 121
    protected function monitorCustomService($software, $service)
123 122
    {
123
        if (!$service) {
124
            return;
125
        }
126

  
124 127
        $this->children[] = new VigiloTest('Service', array('svcname' => $service));
125 128
    }
126 129

  
127 130
    protected function monitorCustomTcp($software, $port)
128 131
    {
132
        if (!$port) {
133
            return;
134
        }
135

  
129 136
        $port = (int) $port;
130 137
        if ($port > 0 && $port <= 65535) {
131 138
            $this->children[] = new Vigilotest('TCP', array('port' => $port));
......
134 141

  
135 142
    protected function monitorCustomProcess($software, $process)
136 143
    {
144
        if (!$process) {
145
            return;
146
        }
147

  
137 148
        $this->children[] = new VigiloTest('Process', array('processname' => $process));
138 149
    }
139 150

  

Also available in: Unified diff