-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_to_graphite.php
More file actions
36 lines (24 loc) · 798 Bytes
/
send_to_graphite.php
File metadata and controls
36 lines (24 loc) · 798 Bytes
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
#!/usr/bin/php
<?php
/**
* Use this file in conjunction with the following perfdata templates in nagios.cfg
*
* host_perfdata_file_template=$TIMET$\t$HOSTNAME$\t$HOSTPERFDATA$
* service_perfdata_file_template=$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEPERFDATA$
*
* Usage:
* ./send_to_graphite <filename>
*/
require_once('/monitoring/libs/NagiosPerfdata.php');
define('ENVIRONMENT','development');
ini_set('display_errors',1);
if(empty($argv[1]) && !file_exists($argv[1])){
echo "Missing perfdata file!\n
Usage: ./send_to_graphite.php <filename> \n"
;
}
$file = $argv[1];
$NagPerf = new NagiosPerfdata($file);
// Set your graphite host if you don't have it hardcoded in the class
//$NagPerf->set_graphite_host('<your graphite host>');
$NagPerf->process_perfdata_file();