zorkian / nagios-api

A REST-like, JSON interface to Nagios
BSD 3-Clause "New" or "Revised" License
586 stars 173 forks source link

Display new problems state #27

Closed dmyerscough closed 11 years ago

dmyerscough commented 11 years ago

Hello Mark, I have added a new state that displays all services that are having problems and have allowed users to specify the nagios.cfg file to pull the status.dat, command file and nagios log locations.

Cool project by the way.

zorkian commented 11 years ago

Thank you so much for submitting this! This is awesome; I had never considered parsing the Nagios configuration file. That's brilliant. :)

I made some comments -- I'd love if you could update the PR and then I'll get this merged in!

dmyerscough commented 11 years ago

Thanks for the feedback :+1:

I have added in a feature to allow Nagios to be reloaded, this will come in handy when I write the functionality to add and remove hosts dynamically.

zorkian commented 11 years ago

Hey -- pull requests should be for small units of functionality. Can you please split this into 2 or 3? For one, the template functionality should be disentangled from the change/addition of the problem state functionality. Any other major changes should be in a separate PR too.

This helps minimize the time-to-merge and review time. I would merge the problem stuff right now, but I don't want to merge the template stuff yet without discussion, and I don't want to hold up the former on the latter. Make sense?

dmyerscough commented 11 years ago

Sorry Mark, I am a little new to Github. I will have a look at only submitting a small patch,

dmyerscough commented 11 years ago

Mark, are you able to merge the other functionality prior to the template and Nagios reload feature? I have looked around and I can't find a good way to submit changes prior without resetting HEAD and then issuing a pushing.

zorkian commented 11 years ago

Generally, people will create several branches -- one for each feature they want to make. Then, you submit a pull request from each branch. That works best if they're separate features and one does not depend on the other.

What I would recommend here is:

  1. creating a new, clean checkout of the nagios-api repository
  2. create a branch in that repository with git branch BRANCH_NAME.
  3. take diffs of your commits (use git diff) from the old repository
  4. apply the diffs on the clean repository on your new branch
  5. commit the changes
  6. submit a pull request on github

This will let you separate the diffs and the commits onto two (or three, whatever you need) separate branches. Then you can create two or three pull requests and I can merge/discuss them individually.

If you're on Freenode, you can find me there as xb95 and I'd be happy to walk you through this real-time!

dmyerscough commented 11 years ago

Thanks xb95.