I had a previous post on this issue but feel it's now burried too deep and is quiet muddled up so I'm posting again to try to be more clear and get it back to the top. I'm not a programmer so please, please help me out!!! What I want to do is this:
1. Read Cisco devices from a file I create: host1.domain.com host2.domain.com host3.domain.com 2. For each device in this list do snmpgets to get: a. a port description for each port (devices will have 16, 24, 48 or m +ore ports) b. the oper status for each port c. the admin status for each port d. the last change status for each port 3. I want the output to be in a CSV format so the file can be opened w +ith Excel 4. The variables I will be polling are: a. snmpwalk interfaces.ifTable.ifEntry.ifDescr public $host b. snmpwalk interfaces.ifTable.ifEntry.ifOperStatus public $host c. snmpwalk interfaces.ifTable.ifEntry.ifAdminStatus public $host d. snmpwalk interfaces.ifTable.ifEntry.ifLastChange public $host 5. Here is a sample snmpwalk for each variable above. a. johnsonr@nmscrme01 > snmpwalk 10.245.159.57 public interfaces.ifTa +ble.ifEntry.ifDescr interfaces.ifTable.ifEntry.ifDescr.1 = FastEthernet0/1 interfaces.ifTable.ifEntry.ifDescr.2 = FastEthernet0/2 interfaces.ifTable.ifEntry.ifDescr.3 = FastEthernet0/3 ..... b. johnsonr@nmscrme01 > snmpwalk 10.245.159.57 public interfaces.ifTa +ble.ifEntry.ifOperStatus interfaces.ifTable.ifEntry.ifOperStatus.1 = up(2) interfaces.ifTable.ifEntry.ifOperStatus.2 = up(2) interfaces.ifTable.ifEntry.ifOperStatus.3 = down(2) ..... c. johnsonr@nmscrme01 > snmpwalk 10.245.159.57 public interfaces.ifTa +ble.ifEntry.ifAdminStatus interfaces.ifTable.ifEntry.ifAdminStatus.1 = up(2) interfaces.ifTable.ifEntry.ifAdminStatus.2 = up(2) interfaces.ifTable.ifEntry.ifAdminStatus.3 = down(2) ..... d. johnsonr@nmscrme01 > snmpwalk 10.245.159.57 public interfaces.ifTa +ble.ifEntry.ifLastChange interfaces.ifTable.ifEntry.ifLastChange.1 = Timeticks: (628809469) 72 +days, 18:41:34.69 interfaces.ifTable.ifEntry.ifLastChange.2 = Timeticks: (2297919248) 26 +5 days, 23:06:32.48 interfaces.ifTable.ifEntry.ifLastChange.3 = Timeticks: (5370) 0:00:53. +70 ..... My goal is this, open the csv file using Excel so the output will look + something like this: FastEthernet0/1 up(2) up(2) Timeticks: (628809469) 72 days, 1 +8:41:34.69 FastEthernet0/2 up(2) up(2) Timeticks: (2297919248) 265 days, + 23:06:32.48 FastEthernet0/3 down(2) down(2) Timeticks: (5370) 0:00:53.70 Of course it would like this before opening it as a .csv FastEthernet0/1,up(2),up(2),Timeticks: (628809469) 72 days, 18:41:34.6 +9 FastEthernet0/2,up(2),up(2),Timeticks: (2297919248) 265 days, 23:06:32 +.48 FastEthernet0/3,down(2),down(2),Timeticks: (5370) 0:00:53.70
Again, please keep in mind my programming skills are pretty much zero.

In reply to snmpwalk to CSV #2 by getwithrob

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.