Ad Widget

Collapse

TEXT value bug in zabbix proxy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zeds
    Junior Member
    Zabbix Certified Specialist
    • Jan 2009
    • 20

    #1

    TEXT value bug in zabbix proxy

    I _think_ there is a bug in zabbix proxy related to active checks and TEXT (at least) values.
    Zabbix server - version 1.8.3 Linux 2.6
    zabbix proxy - version 1.8.3 Solaris 8
    zabbix agent - version 1.8.3 Solaris 8

    I have client ( Solaris 8 ) monitored by a by a passive zabbix agent checks (CPU etc).
    I wanted to add an active check , custom script

    Code:
    #!/bin/perl
    my @mas=`/usr/sbin/metastat|/usr/bin/grep State:`;
    my $Fail="NO";
    
    foreach(@mas)
     {
     chomp($_);
     s/\s+//g;
    #DBG print "$_\n";
     $i=$_;
     if( $i ne "State:Okay" )
      {
      $Fail="YES";
      }
     }
    
    #DBG print "Fail:$Fail\n";
    if( $Fail eq "YES" )
     {
     print "FAIL\n";
     exit 1;
     }
     else 
     {
     print "OK\n";
     exit 0;
     }
    Script returns TEXT value "OK" or "FAIL" depending on state of metadevices.
    So I added a line to zabbix_agentd.conf
    Code:
    UserParameter=solaris.disksuite,/opt/zabbix/bin/disksuite_status.pl
    I could see that script runs and sends a value to zabbix_proxy
    Code:
    9052:20100907:125907.548 Before
    9052:20100907:125907.548 Run remote command [/opt/zabbix/bin/disksuite_status.pl] Result [2] [OK]...
    9052:20100907:125907.549 Sending back [OK]
    also I could see that this value is received by proxy
    Code:
    22084:20100907:125907 In add_history(itemid: 29347,key:"solaris.disksuite",value_type:4,TEXT:[OK])
     22084:20100907:125907 In proxy_add_history_text()
     22084:20100907:125907 Query [insert into proxy_history (itemid,clock,value) values (29347,1283853547,'')]
     22084:20100907:125907 End of proxy_add_history
    then this value is missing when sent to server as well:

    Code:
    22081:20100907:125908 In connect_to_server() [10.150.23.11]:10051 [timeout:600]
    22081:20100907:125908 In put_data_to_server() [datalen:797]
    22081:20100907:125908 In send_data_to_server() [{
            "request":"history data",
            "host":"man301",
            "data":[
                    {
                            "host":"app101",
                            "key":"system.cpu.switches",
                            "clock":1283853547,
                            "value":"2338899668"},
                    {
                            "host":"man301",
                            "key":"system.cpu.util[all,idle]",
                            "clock":1283853547,
                            "value":"94.255095"},
                    {
                            "host":"app202",
                            "key":"system.cpu.switches",
                            "clock":1283853547,
                            "value":"22976963124"},
                    {
                            "host":"www101",
                            "key":"system.cpu.util[all,idle]",
                            "clock":1283853547,
                            "value":"68.384309"},
                    {
                            "host":"www202",
                            "key":"system.cpu.util[all,idle]",
                            "clock":1283853547,
                            "value":"56.940407"},
                    {
                            "host":"www201",
                            "key":"icmpping",
                            "clock":1283853547,
                            "value":"0"},
                    {
                            "host":"www101",
                            "key":"solaris.disksuite",
                            "clock":1283853547,
                            "value":""}],
            "clock":1283853548}]
     22081:20100907:125908 In recv_data_from_server()
     22081:20100907:125908 Received [{
            "response":"success",
            "info":"Processed 7 Failed 0 Total 7 Seconds spent 0.000312"}] from server
     22081:20100907:125908 End of put_data_to_server():SUCCEED
    It seems to me ( please don't kick me if I am wrong ) - proxy_add_history_text() , loses a value, because value column in insert statement is empty string.
Working...