Comments (5)
Hi all,
Sorry for the huge delay on this. I didn't took the time to maintain this project a lot this year.
The issue is now fixed. After some additional debugging, the fact is that the problem was triggered by having \n
exactly as the 1024th character in the middle of a Livestatus response.
from go-livestatus.
Hi @ianrapha,
Any chance you can provide me with the services.csv
file (if not that sensitive)?
Which version of MKLivestatus are you using?
from go-livestatus.
Hello @vbatoufflet
Sorry, I cannot provide the content right now. I'll try to remove the sensitive parts and attach here. The file size is 106496 bytes and 915 lines.
I tested with all tables and the problem occurred only on services table.
The MKLs version is 1.2.8.
from go-livestatus.
Probably something is happening with OutputFormat: json.
After commenting this line the extraction worked well.
from go-livestatus.
I have also noticed this problem when retrieving larger numbers of services.
Filtering for state = 0 with approx 800 results works. On a larger Nagios installation with approx 1800 results, I get "Error: unexpected end of JSON input".
Looking at the Exec() function in query.go, data is created with a length of 1024 and there is then a check for new line:
if data[n-1] == byte('\n') {
break
}
If I temporarily change this:
if data[n-1] == byte('\n') {
fmt.Printf("New line found: %d\n", n)
}
I then see the new line being found several times before reaching the end of the data, which is why a larger set of results is truncated, but a smaller set is okay.
New line found: 1024
New line found: 1024
New line found: 147
So as a quick workaround I changed the length of data to 10240.
from go-livestatus.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-livestatus.