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

ValueError: need more than 1 value to unpack. (old script) #10

Open
jva5007 opened this issue Oct 19, 2015 · 2 comments
Open

ValueError: need more than 1 value to unpack. (old script) #10

jva5007 opened this issue Oct 19, 2015 · 2 comments
Assignees
Labels

Comments

@jva5007
Copy link

jva5007 commented Oct 19, 2015

I tried to run this script from our monitoring server for a remote host running Apache 2.4.16, but when I excecute cron, it returns the following error.

Traceback (most recent call last):
File "/usr/local/plugin/fetch.py", line 225, in
data = parse(data = data)
File "/usr/local/plugin/fetch.py", line 78, in parse
for (key, val) in csvobj:
ValueError: need more than 1 value to unpack

I have added hostname before each item key in the template.

When I add print data in 77th line in the script it shows correct data from apache server along with the error above. I also checked with 'print repr(csvobj)' but it shows the following.

<_csv.reader object at 0x7f04feca5a60>
Traceback (most recent call last):
File "/usr/local/plugin/fetch.py", line 225, in
data = parse(data = data)
File "/usr/local/plugin/fetch.py", line 78, in parse
for (key, val) in csvobj:
ValueError: need more than 1 value to unpack

remote host is an amazon ec2 instance.

@jva5007 jva5007 changed the title ValueError: need more than 1 value to unpack old script ValueError: need more than 1 value to unpack. (old script) Oct 19, 2015
@gpmidi
Copy link
Owner

gpmidi commented Nov 28, 2015

Can I get a copy of "/server-status?auto"? I suspect that there is a slight difference between the way the CSV parser is set to work vs what Apache is doing.

@gpmidi gpmidi self-assigned this Nov 28, 2015
@galindro
Copy link
Contributor

galindro commented Dec 4, 2015

@gpmidi this is my server-status page. The same error is ocurring with me:

ServerVersion: Apache/2.4.16 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.0.1f
ServerMPM: worker
Server Built: 2015-09-08T00:00:00
CurrentTime: Friday, 04-Dec-2015 12:55:46 UTC
RestartTime: Friday, 04-Dec-2015 12:46:34 UTC
ParentServerConfigGeneration: 1
ParentServerMPMGeneration: 0
ServerUptimeSeconds: 552
ServerUptime: 9 minutes 12 seconds
Load1: 3.79
Load5: 1.03
Load15: 0.74
Total Accesses: 658
Total kBytes: 31790
CPUUser: 1.62
CPUSystem: .13
CPUChildrenUser: 0
CPUChildrenSystem: 0
CPULoad: .317029
Uptime: 552
ReqPerSec: 1.19203
BytesPerSec: 58972.8
BytesPerReq: 49472.6
BusyWorkers: 114
IdleWorkers: 6
Scoreboard: .R...R.RRRRRR.RRRRRRWKWWWWRWWWR..R.RRR.RWWWRWWWWRWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWRWRWWWWWRWWWKWWWWWRWWWWWWWWWKKWWWWWWWWWWWWRWWWWWWWWWWWW___KR_RW__..................................................
TLSSessionCacheStatus
CacheType: SHMCB
CacheSharedMemory: 512000
CacheCurrentEntries: 0
CacheSubcaches: 32
CacheIndexesPerSubcaches: 88
CacheIndexUsage: 0%
CacheUsage: 0%
CacheStoreCount: 0
CacheReplaceCount: 0
CacheExpireCount: 0
CacheDiscardCount: 0
CacheRetrieveHitCount: 0
CacheRetrieveMissCount: 0
CacheRemoveHitCount: 0
CacheRemoveMissCount: 0

ericrisler added a commit to ericrisler/zabbix-apache-stats that referenced this issue Feb 27, 2017
I'm no python guy so please review.

gpmidi#9: gpmidi#9
gpmidi#10: gpmidi#10

Apache server-status that outputs the TLSSessionCacheStatus section breaks the csv reader since that line contains no ":". 

I've added a breakout condition to end parsing the server-status after the Scorebaord status.
ericrisler added a commit to ericrisler/zabbix-apache-stats that referenced this issue Feb 27, 2017
Skip "TLSSessionCacheStatus" line as it causes parse error.

Fix for: gpmidi#9 and gpmidi#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants