imperva / imperva/mx-toolbox

Script stops gathering data

Open
#9 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
16
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Hi,
I notice I am missing data from time to time. In logs is following? Any Idea what is wrong?
2023-06-14T08:20:01.150528+02:00 localhost CROND[22569]: (root) CMD (/usr/bin/python /var/user-data/get_gateway_stats.py)
2023-06-14T08:20:01.151041+02:00 localhost CROND[22568]: (root) CMD (/usr/lib64/sa/sa1 1 1)
2023-06-14T08:20:01.837622+02:00 localhost CROND[22565]: (root) CMDOUT (Traceback (most recent call last):)
2023-06-14T08:20:01.838951+02:00 localhost CROND[22565]: (root) CMDOUT ( File "/var/user-data/get_gateway_stats.py", line 699, in )
2023-06-14T08:20:01.839275+02:00 localhost CROND[22565]: (root) CMDOUT ( run())
2023-06-14T08:20:01.839594+02:00 localhost CROND[22565]: (root) CMDOUT ( File "/var/user-data/get_gateway_stats.py", line 191, in run)
2023-06-14T08:20:01.839915+02:00 localhost CROND[22565]: (root) CMDOUT ( getSysStats())
2023-06-14T08:20:01.840219+02:00 localhost CROND[22565]: (root) CMDOUT ( File "/var/user-data/get_gateway_stats.py", line 390, in getSysStats)
2023-06-14T08:20:01.840518+02:00 localhost CROND[22565]: (root) CMDOUT ( sysStat.append("current_revision=" + revision_update_data[current_revision_index]))
2023-06-14T08:20:01.840838+02:00 localhost CROND[22565]: (root) CMDOUT (IndexError: list index out of range)
...
2023-06-14T08:30:01.855446+02:00 localhost CROND[29578]: (root) CMD (/usr/lib64/sa/sa1 1 1)
2023-06-14T08:30:01.856369+02:00 localhost CROND[29579]: (root) CMD (/usr/sbin/logrotate /etc/logrotate.conf)
2023-06-14T08:30:01.857190+02:00 localhost CROND[29580]: (root) CMD (/usr/bin/python /var/user-data/get_gateway_stats.py)
2023-06-14T08:30:01.884208+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring an-phase1 because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:01.886266+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring oracle because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:01.886751+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring pce because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:01.887236+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring server-ha because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:01.887737+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring sqlplus because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:01.888886+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring waagent-extn.logrotate because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:01.889392+02:00 localhost CROND[29563]: (root) CMDOUT (error: Ignoring waagent.logrotate because of bad file mode - must be 0644 or 0444.)
2023-06-14T08:30:02.588399+02:00 localhost CROND[29565]: (root) CMDOUT (Traceback (most recent call last):)
2023-06-14T08:30:02.588861+02:00 localhost CROND[29565]: (root) CMDOUT ( File "/var/user-data/get_gateway_stats.py", line 699, in )
2023-06-14T08:30:02.589162+02:00 localhost CROND[29565]: (root) CMDOUT ( run())
2023-06-14T08:30:02.589435+02:00 localhost CROND[29565]: (root) CMDOUT ( File "/var/user-data/get_gateway_stats.py", line 191, in run)
2023-06-14T08:30:02.589699+02:00 localhost CROND[29565]: (root) CMDOUT ( getSysStats())
2023-06-14T08:30:02.590009+02:00 localhost CROND[29565]: (root) CMDOUT ( File "/var/user-data/get_gateway_stats.py", line 390, in getSysStats)
2023-06-14T08:30:02.590278+02:00 localhost CROND[29565]: (root) CMDOUT ( sysStat.append("current_revision=" + revision_update_data[current_revision_index]))
2023-06-14T08:30:02.590543+02:00 localhost CROND[29565]: (root) CMDOUT (IndexError: list index out of range)

BR

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with get_gateway_stats.py, especially getSysStats() around line 390 and the call from run() at line 191. Inspect how revision_update_data and current_revision_index are populated, then reproduce the cron execution that raises IndexError. Done means the script no longer stops at this traceback and continues gathering data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.