Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support (Russian)
  3. Фильтр цветных принтеров

Фильтр цветных принтеров

Scheduled Pinned Locked Moved Support (Russian)
6 Posts 3 Posters 13.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    TOLeg
    wrote on last edited by
    #1

    Для настройки метрик в шаблоне как настроить фильтр цветных принтеров HP, Xerox?

    1 Reply Last reply
    0
    • J
      J
      JuraSSik
      wrote on last edited by
      #2

      if (!$node->isSNMP)
          return false;
      if (
          ( $node->snmpOID like ".1.3.6.1.4.1.253.8.62.1.19.5.5.*")
       { return true; }

      1 Reply Last reply
      0
      • T
        T
        TOLeg
        wrote on last edited by
        #3

        Предложенное выше решение не работает 😞

        Сделал такой фильтр для Xerox 7428. Ругается на if (model like "*7428*"). подскажите, что не так?

        transport = CreateSNMPTransport($node);
        if (transport == null)
        {
          trace(1,"Snmp transport error on ".$node->ipAddr);
          return -1;
        }
        model = SNMPGetValue(transport, ".1.3.6.1.2.1.25.3.2.1.3.1");
        if (model like "*7428*")
        {
          return $1;
        }
        else
        {
          trace(1,"Could not read value for ".$node->ipAddr);
          return -1;
        }

        1 Reply Last reply
        0
        • F
          F
          Filipp Sudanov
          wrote on last edited by
          #4

          А как именно ругается? может быть SNMPGetValue не срабатывает и model получается NULL ?

          1 Reply Last reply
          0
          • T
            T
            TOLeg
            wrote on last edited by
            #5

            Ругается так:
             
             Failed to execute autobind script for object 7428 [9255] (Error 5 in line 8: Invalid operation with NULL value)

            Решено.
            Можно фильтровать по описанию:
            return $node->sysDescription like "Xerox WorkCentre 7428*";

            можно по snmpOID
            return $node->snmpOID == ".1.3.6.1.4.1.253.8.62.1.20.5.3.1";

            Если несколько моделей принтеров, то придётся указывать все через &&.

            1 Reply Last reply
            0
            • F
              F
              Filipp Sudanov
              wrote on last edited by
              #6

              Ну да, если нода не смогла ответить по конкретному SNMP OIDу, то в model получалось null.
              Там просто проверку можно добавить, аналогично как проверялось что SNMP транспорт создался:
              if (model == null)...

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              Powered by NodeBB Contributors
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups