I want set a customize discovery rule. the customize file is:
<?php
$item = $argv[1];
$filelocation="/usr/local/testphp/mizan";
switch($item)
{
case "jsonformat":
$output = "{"data":[ {"{#name}":"".$filelocation.""} ] }";
echo "$output";
break;
case "uptime":
$id= $argv[2];
$value=$id;
$comand=shell_exec('stat ".$value."');
echo "$comand";
break;
default:
$output = "{"data":[ {"{#name}":"".$item.""} ] }";
}
?>
Discovery rule key : test[jsonformat] and got the response like below:
{"data":[ {"{#name}":"/usr/local/testphp/mizan"} ] }[
i have set item prototype key like this : test[uptime,{#name}] and it showed that item with the same key "test[uptime,{#name}]" already exists.
Zabbix agent is installed in Linux Server and php is installed also.In Zabbix_agent.conf file i have set the UserParameter like this :
UserParameter=test[*], php "/usr/local/testphp/test1.php" "$1" "$2"
**Couldn't Understand where is the problem**
<?php
$item = $argv[1];
$filelocation="/usr/local/testphp/mizan";
switch($item)
{
case "jsonformat":
$output = "{"data":[ {"{#name}":"".$filelocation.""} ] }";
echo "$output";
break;
case "uptime":
$id= $argv[2];
$value=$id;
$comand=shell_exec('stat ".$value."');
echo "$comand";
break;
default:
$output = "{"data":[ {"{#name}":"".$item.""} ] }";
}
?>
Discovery rule key : test[jsonformat] and got the response like below:
{"data":[ {"{#name}":"/usr/local/testphp/mizan"} ] }[
i have set item prototype key like this : test[uptime,{#name}] and it showed that item with the same key "test[uptime,{#name}]" already exists.
Zabbix agent is installed in Linux Server and php is installed also.In Zabbix_agent.conf file i have set the UserParameter like this :
UserParameter=test[*], php "/usr/local/testphp/test1.php" "$1" "$2"
**Couldn't Understand where is the problem**
Comment