Quantcast
Channel: Monitoring-Portal Feed
Viewing all articles
Browse latest Browse all 1338

[Solved] how can use a check-command with a nagios plugin in PHP example check_hjpd_new.php

$
0
0

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
object CheckCommand "check_hpjd_new" {
  import "plugin-check-command"

  command = [ PluginDir + "/check_hpjd_new.php"  ]

  arguments = {
	"-H" = "$check_hpjd_new_address$"
	"-C" = "$snmp_community$"
	"-w" = "$hpjd_new_warning$"
	"-c" = "$hpjd_new_critical$"


  }

 vars.check_hpjd_new_address = "$address$"
  vars.snmp_community = "public"
  vars.hpjd_new_warning= "10"
  vars.hpjd_new_critical= "5"


}



Quellcode

1
2
3
4
apply Service " printer status" {
  check_command = "check_hpjd_new"
  assign where match ("*printer", host.name)
}


Plugin Output:

Quellcode

1
2
3
/usr/lib/nagios/plugins/check_hpjd_new.php: 1: /usr/lib/nagios/plugins/check_hpjd_new.php: cannot open ?php: No such file
/usr/lib/nagios/plugins/check_hpjd_new.php: 3: /usr/lib/nagios/plugins/check_hpjd_new.php: =: not found
/usr/lib/nagios/plugins/check_hpjd_new.php: 4: /usr/lib/nagios/plugins/check_hpjd_new.php: Syntax error: word unexpected (expecting ")")



Basically I need to add /usr/bin/php in front of

Zitat

command = [ PluginDir + "/check_hpjd_new.php"
how can I do that ?


thank you

Viewing all articles
Browse latest Browse all 1338