Ad Widget

Collapse

windows agent: simple 'cut' functionality

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robbertwethmar
    Junior Member
    • Mar 2007
    • 7

    #1

    windows agent: simple 'cut' functionality

    i've been trying to configire the windows agent to do what i want. One of the problems i run into is that 'UserParameter' are difficult to use, because command line filters like 'cut', 'grep', 'sed' and others don't exist in a standard windows system.

    of course i can install them, but that will make the installation much more difficult and won't help performance.

    In many cases I just want and some columns (cut) from some line (find) and trim the spaces. It would be great if UserParameter could have a line nr, position, and nr of chars to get a number or text from the output of a command.

    it would be usable for:
    geting ip, gateway or other info from 'ipconfig /all'
    getting tcp/udp/ip statistics from 'netstat -s'
    getting network statistics from 'netstat -e'
    getting logged in username from ''pulist | find /I "explorer.exe" (pulist is process list from win resource kit)
  • ad@kbc-clearing.com
    Member
    • Sep 2005
    • 77

    #2
    Awk

    Have you tried awk ?
    A very powerful lightweight tool !
    If you need more tips on zabbix, contact me directly.

    Comment

    • James Wells
      Senior Member
      • Jun 2005
      • 664

      #3
      Greetings,

      Perhaps a better way to do this is to write cmd scripts that pull the data, then use system.run to call the scripts. IIRC cmd scripts can do all kinds of variable manipulation, including things like cut, split, and trim. Please note it has been about 3 years since I wrote a cmd script so I could be mistaken.
      Unofficial Zabbix Developer

      Comment

      Working...