Ad Widget

Collapse

Zabbix Host add error.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vaasnth
    Junior Member
    • Dec 2011
    • 5

    #1

    Zabbix Host add error.

    Hi All,

    I am facing the following error while adding the HOST using Zabbix PERL API
    ERROR: "Zabbix server replied: [ CTemplate::massAdd ] You do not have permission to perform this operation"

    Can any one please help on this?
  • Vaasnth
    Junior Member
    • Dec 2011
    • 5

    #2
    Does any one worked on Zabbix Perl API???????

    Comment

    • Vaasnth
      Junior Member
      • Dec 2011
      • 5

      #3
      Solveed

      Solved by own...

      Thanks guys.

      Comment

      • chokies
        Junior Member
        • May 2012
        • 10

        #4
        how were you able to solve this one?

        Comment

        • Vaasnth
          Junior Member
          • Dec 2011
          • 5

          #5
          Set of CODE

          The following sort of code will help you to resolve the issue.

          #Create Host
          my $create_host = create_host("$HOST_NAME", "$HOST_IP", $HOST_PORT", "$host_groupId", "$templateID");
          my $rights = add_rights("$user_groupId", "2", "$host_groupId");
          $message .= "* Host added Successfully...\n";

          # Create Host
          # Usage : create_host(host, ip, port, groupid, template);
          ################################################## #######################
          sub create_host {
          ($h_name, $h_ip, $h_port, $g_id, $t_id) = @_;
          my $CHost = $zabbix->query(method => 'host.create', params => {
          host => "$h_name",
          ip => "$h_ip",
          port => "$h_port",
          useip => 1,
          groups => {groupid => $g_id},
          templates => {templateid => $t_id}
          });
          return($CHost);
          }

          Comment

          Working...