Ad Widget

Collapse

How to create a UserParameter with a c++ program??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ismael Medina
    Junior Member
    • Mar 2007
    • 15

    #1

    How to create a UserParameter with a c++ program??

    I created a c++ application to count files in a folder and I want to create an item to get this value, but no value is received

    the "main" function is ...

    int main(int argv, char *argc[])
    {
    int iNumberOfFiles = -1;

    if (argv != 3)
    std::cout << "Uso: filecount ruta extension \n";
    else
    iNumberOfFiles = SearchDirectory(argc[1], argc[2]);

    std::cout << "Archivos encontrados: " << iNumberOfFiles << std::endl;

    return iNumberOfFiles;
    }

    The UserParameters...

    UserParameter=queued,"D:\Program Files\Zabbix\FileCount.exe" "C:\Inetpub\mailroot\Queue" txt
    UserParameter=pickedup,"D:\Program Files\Zabbix\FileCount.exe" "C:\Inetpub\mailroot\Pickup" txt

    The Items ...

    18066 win-vmqabxismtp-SMTPPickedUp pickedup 300 90 365 ZABBIX agent (active) Active
    18065 win-vmqabxismtp-SMTPQueued queued 300 90 365 ZABBIX agent (active) Active

    The Latest data...

    win-vmqabxismtp-disk_queue 20 Mar 15:06:53 0.01 -0.01 Graph
    win-vmqabxismtp-ping 20 Mar 15:06:26 0.000320s -0.00031s Graph
    win-vmqabxismtp-processor_time 20 Mar 15:05:54 3.34 % -1.63 % Graph
    win-vmqabxismtp-SMTPPickedUp 20 Mar 14:40:00 - - Graph
    win-vmqabxismtp-SMTPQueued 20 Mar 14:50:00 - - Graph
    win-vmqabxismtp-SMTP_service 20 Mar 15:02:45 0 - Graph
    win-vmqabxismtp-TELNET_service 20 Mar 15:00:08 6 - Graph
    win_vmqabxismtp-mempages 20 Mar 15:05:22 0.03 p +0.02 p Graph
    Last edited by Ismael Medina; 20-03-2007, 21:55. Reason: Complement
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,
    Originally posted by Ismael Medina
    - - Graph
    win-vmqabxismtp-SMTPQueued 20 Mar 14:50:00 - - Graph
    Right off the bat, it appears that you are returning string data, but your item is configured for integer or float data. Zabbix uses the data that is returned to STDOUT, which in this case looks like it is returning "Archivos encontrados: " followed by a number.
    Unofficial Zabbix Developer

    Comment

    • Ismael Medina
      Junior Member
      • Mar 2007
      • 15

      #3
      , Thank you James, now I understand how I can develop my own parameters.

      Now it works.

      Thank you.

      Comment

      • tronite
        Senior Member
        • Jun 2007
        • 147

        #4
        Originally posted by Ismael Medina
        I created a c++ application to count files in a folder Graph
        And this worked but the...

        Comment

        • tronite
          Senior Member
          • Jun 2007
          • 147

          #5
          Originally posted by tronite
          And this worked but the...
          Oops! I did not mean for that.

          Comment

          Working...