1 | <?php |
||||
2 | |||||
3 | use LibreNMS\RRD\RrdDefinition; |
||||
4 | |||||
5 | $name = 'entropy'; |
||||
6 | $app_id = $app['app_id']; |
||||
7 | $options = '-Oqv'; |
||||
8 | $mib = 'NET-SNMP-EXTEND-MIB'; |
||||
9 | $oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.101.110.116.114.111.112.121.1'; |
||||
10 | |||||
11 | $rrd_name = ['app', $name, $app_id]; |
||||
12 | $rrd_def = RrdDefinition::make()->addDataset('entropy', 'GAUGE', 0); |
||||
13 | |||||
14 | $entropy_avail = snmp_get($device, $oid, $options, $mib); |
||||
15 | |||||
16 | $fields = ['entropy' => $entropy_avail]; |
||||
17 | |||||
18 | $tags = ['name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name]; |
||||
19 | data_update($device, 'app', $tags, $fields); |
||||
20 | update_application($app, $entropy_avail, $fields, $entropy_avail); |
||||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
It seems like
$entropy_avail can also be of type false ; however, parameter $status of update_application() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
21 |