I've had this happen every single time I've installed nagios & nagiosgraph, on CentOS and on Ubuntu/Debian, regardless of any instructions I've ever found. Somewhere I have stumbled upon a fix, or what exactly it is I have to change to get this working, but for the life of me I can't remember what it is. I currently have the second-to-latest version installed and I'm too scared to upgrade it lest I get this same error once again when I do.