-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheck_mia_squid_disk.php
executable file
·49 lines (43 loc) · 1.85 KB
/
check_mia_squid_disk.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/local/bin/php5 -q
<?php
require_once('lib/MiaNagiosPluginSNMPSimple.inc.php');
class MiaNagiosPlugin_CheckSquidDisk extends MiaNagiosPluginSNMPSimple{
/**
* (non-PHPdoc)
* @see nagios/plugins/lib/MiaNagiosPlugin#setSpecialProperties()
*/
protected function setSpecialProperties(){
$this->setSpecialProperty('intituleStatus','SQUID_DISK');
$this->setSpecialProperty('titre_aide','Plugins Nagios indiquant l\'espace disque a loué à squid dans sa conf et à l\'espace disque effectivement utilisé par squid');
$this->setSpecialProperty('commentaire_aide','');
}
/**
* (non-PHPdoc)
* @see nagios/plugins/lib/MiaNagiosPlugin#setIndicators()
*/
protected function setIndicators(){
$this->addIndicatorSnmpSimple('squid_disk_conf','.1.3.6.1.4.1.3495.1.2.5.2');
$this->addIndicatorSnmpSimple('squid_disk_val','.1.3.6.1.4.1.3495.1.1.2');
$this->setIndicatorUnit('squid_disk_conf','GB');
$this->setIndicatorUnit('squid_disk_val','GB');
}
protected function dataFilter($name,$value){
switch($name) {
case 'squid_disk_conf':
$value=MiaNagiosPluginFilters::dataFilterPrecision(
$name,MiaNagiosPluginFilters::dataFilterUnitToKilo($name,$value),1);
break;
case 'squid_disk_val':
$value=MiaNagiosPluginFilters::dataFilterPrecision(
$name,MiaNagiosPluginFilters::dataFilterUnitToMega($name,$value),1);
break;
Default:
}
return $value;
}
protected function StatusInformationFilter($name,$value){
return $name."=".$value."GB";
}
}
$check=new MiaNagiosPlugin_CheckSquidDisk();
$check->OutputResult();