Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appears to not work with LVM volumes containing underscores in name #6

Open
gadg3ts opened this issue Mar 28, 2014 · 0 comments
Open

Comments

@gadg3ts
Copy link

gadg3ts commented Mar 28, 2014

I'd previously installed the collector scripts on a number of Ubuntu machines where all was good. Now I'm putting it on some RedHat machines and I wasn't getting all of the volume names from an snmpwalk.

[root@monitor01 ~]# snmpwalk -v2c -c public hostname .1.3.6.1.3.1.2
SNMPv2-SMI::experimental.1.2.1 = STRING: "cciss/c0d0"
SNMPv2-SMI::experimental.1.2.2 = STRING: "cciss/c0d1"
SNMPv2-SMI::experimental.1.2.3 = ""
SNMPv2-SMI::experimental.1.2.4 = ""
SNMPv2-SMI::experimental.1.2.5 = ""
SNMPv2-SMI::experimental.1.2.6 = ""
SNMPv2-SMI::experimental.1.2.7 = ""
SNMPv2-SMI::experimental.1.2.8 = ""
SNMPv2-SMI::experimental.1.2.9 = ""

Turns out the difference between the machines was that some of the LVM volumes contain underscores:
$ iostat -N -xkd | awk '{print $1}'
Device:
cciss/c0d0
cciss/c0d1
vg_sas-lv_root
vg_sas-lv_swap
vg_sas-lv_attachments
vg_sas-sas_logs
vg_sas-sas_httpdcache
vg_ssd-lv_attachments
vg_ssd-lv_cache

My perl is a bit rusty, so I've taken the simpler option and added another sed replace to the collector crontab entry:

  • * * * * root cd /tmp && iostat -N -xkd 30 2 | sed 's/,/./g' | sed 's/_/-/g' > io.tmp && mv io.tmp iostat.cache

This now gives me:
[root@monitor01 ~]# snmpwalk -v2c -c public hostname .1.3.6.1.3.1.2
SNMPv2-SMI::experimental.1.2.1 = STRING: "cciss/c0d0"
SNMPv2-SMI::experimental.1.2.2 = STRING: "cciss/c0d1"
SNMPv2-SMI::experimental.1.2.3 = STRING: "vg-sas-lv-root"
SNMPv2-SMI::experimental.1.2.4 = STRING: "vg-sas-lv-swap"
SNMPv2-SMI::experimental.1.2.5 = STRING: "vg-sas-lv-attachments"
SNMPv2-SMI::experimental.1.2.6 = STRING: "vg-sas-sas-logs"
SNMPv2-SMI::experimental.1.2.7 = STRING: "vg-sas-sas-httpdcache"
SNMPv2-SMI::experimental.1.2.8 = STRING: "vg-ssd-lv-attachments"
SNMPv2-SMI::experimental.1.2.9 = STRING: "vg-ssd-lv-cache"

Thanks,
Sean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant