Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: snmpget How to?

  1. #1

    Default snmpget How to?

    To All:

    Recently I have been getting more involved in replacing some perl scripts I have that do alot of snmpget commands and playing around with the best way in 4.2 to get data back from many devices.

    What I have been trying to do is to read from a DB table and get the IP address, pass to a run ssh command and return the value this is not working out very well though and is proving much more difficult than I figured it would be. How is anyone else doing it? Anyone have a sample transformation they would be willing to share?

    The end format of the snmpget needs to be similar to

  2. #2
    Join Date
    Sep 2009
    Posts
    810

    Default

    If the machine running the transformation can call snmpget directly, I don't see any problem. Just use a execute process step (multiple copies of it, preferably) and you should be set.
    Hmm, would you have a demo transformation for us that would work on some public snmp enabled machines? Maybe if we can look at something concrete, we can suggest ways of improving the design.

    Cheers
    Slawo

  3. #3

    Default

    I dont have anything that is internet facing (I am working on a intranet)

    I had not checked out the execute process step but I think I am going to see the same problem with that as I am having with ssh

    The end result of the command executed needs to be

    /usr/local/bin/snmpget -r 4 -Cf -v1 -t 2 -c public 10.10.10.10 enterprises.318.1.1.1.2.1.1.0
    Returns
    SNMPv2-SMI::enterprises.318.1.1.1.2.1.1.0 = INTEGER: 2


    The 10.10.10.10 is the IP address that is read from a table (In the above case it is a APC UPS checking Battery Status)


    When playing with the ssh part I can do something on the selct like
    select
    group_concat('/usr/local/bin/snmpget -r 4 -Cf -v1 -t 2 -c public ",IP_Address,'enterprises.318.1.1.1.2.1.1.0" as "Command to run on the system"
    from IP_Table

    but to get SSH to run more than one time I have select "get commands from field" which is a static value

    Execute a process looks to be the same way..

    Basically how do I plug a variable into the middle of a local process command or a ssh command?

    I hope that helps and any help would be appreciated

  4. #4
    Join Date
    Sep 2009
    Posts
    810

    Default

    Use the general capabilities of PDI to construct the command at runtime

    Attaching a sample that works from command templates and replaces the IP dynamically. Just attach an execute process step and configure it appropriately

    Cheers
    Slawo
    Attached Files Attached Files

  5. #5

    Default

    THANK YOU!!!

    Now to take the next 30 minutes and figure out what the heck you did as at first glance I have no clue yet what is going on

  6. #6
    Join Date
    Sep 2009
    Posts
    810

    Default

    Oh well just preview the output of each step starting from the start and you'll get the hang of it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.