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

csv export #30

Open
KlavsKlavsen opened this issue Nov 6, 2013 · 7 comments
Open

csv export #30

KlavsKlavsen opened this issue Nov 6, 2013 · 7 comments

Comments

@KlavsKlavsen
Copy link

Just got a question to deliver a list for a boss, who wanted to "play with the results" in a spreadsheet.

Found myself missing puppet-dashboard's CSV export feature :)

It would be great, if one could export all lists (complete list of nodenames, and also resultsets under facts) as csv.

@daenney
Copy link
Member

daenney commented Nov 6, 2013

You're going to have to be a bit more specific here. I never used the CSV export so I have no idea what data it exported and how that was structured.

@KlavsKlavsen
Copy link
Author

the idea was to merely get the resultset in a csv export format.
f.ex. a fact search on physicalprocessorcount - which shows a list of nodenames and a number, would simply have a ilnk to "csv export", which would return a list with:
name, physicalprocessorcount
node1.example.net,2
node2.example.net,1

@dominiquearpin
Copy link

Hi,
i'm maybe little late, but here a simple way to do it:
#!/usr/bin/python
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
from pypuppetdb import connect
db = connect()

facts = db.facts()
for fact in facts:
print fact.node + ';', fact.name + ';', fact.value

And you can parse it to create your final csv file.

regards

@larsnaesbye
Copy link
Contributor

Are there any plans to add this as a feature? I too could use it in my organisation.

@larsnaesbye
Copy link
Contributor

@KlavsKlavsen Did you find a usable workaround that we can add as pull request, or should we work on it?

@KlavsKlavsen
Copy link
Author

@larsnaesbye I'm sorry I really have forgotten how I resolved this.. I think I just wrote some python - using pypuppetdb plugin - which can easily get a list hosts who has a certain fact and the facts contents. Thats what I'd do today anyways :)

@larsnaesbye
Copy link
Contributor

larsnaesbye commented Sep 19, 2017

@KlavsKlavsen : okay, that sounds reasonable. I just think it would be better if we implemented a simple button/link that dumped the table to CSV or similar.

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

No branches or pull requests

5 participants