mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-01 09:37:06 +09:00
* Improve native SNMP session error logging * Preserve SNMP warnings when operations throw * Add complete SNMP coverage gate * Simplify four-byte SNMP hex formatting * fix(snmp): reject invalid v3 protocol combinations * ci(coverage): isolate SNMP coverage workflow * Exclude isolated SNMP coverage from unit suite * fix: Properly initialize snmp_value variable --------- Co-authored-by: TheWitness <thewitness@cacti.net>
30 lines
533 B
PHP
Executable File
30 lines
533 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
$mode = getenv('CACTI_SNMP_PROBE_MODE') ?: 'get';
|
|
|
|
if ($mode === 'timeout') {
|
|
print 'Timeout: No Response';
|
|
exit(1);
|
|
}
|
|
|
|
if ($mode === 'error') {
|
|
print 'probe failure';
|
|
exit(2);
|
|
}
|
|
|
|
if ($mode === 'tooBig') {
|
|
print 'Error in packet: (tooBig)';
|
|
exit(1);
|
|
}
|
|
|
|
if ($mode === 'walk') {
|
|
print ".1.3.6.1.2.1.1.1.0 = STRING: coverage agent\n";
|
|
print " continuation\n";
|
|
print "invalid-oid = STRING: rejected\n";
|
|
print ".1.3.6.1.2.1.1.2.0 = STRING: End of MIB\n";
|
|
exit(0);
|
|
}
|
|
|
|
print 'STRING: "coverage value"';
|