Okay, i have this problem and i would like someone from you people to help me out.<br><br>I am developing a software which would list "publicly available services which are monitorable by nagios" (listed at: <a href="http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html">http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html</a>). Problem is:<br>
1. These services may or may not be running on the system at the time of check.<br>2. How to check?<br>---a. On irc i was suggested using dpkg-l or rpm -a and then grep, but that is distro dependent, is there a generalized way to do this? Or should i do this manually?<br>
------i. if you say that i do it via lsb_relase -a, but that will given different output for even Linux, isn it? Does it mean that first i will have to cretae an array of Debian based distros and red hat based ones, then do lsb_release -a, check from which group the distro belongs to, and then use dpkg -l or rpm -qa and search for what??? (what should i be searching for in the installed service list? coz in my experience for apache, dpkg -l shows apache, while rpm -qa will shows httpd, am i right? if yes then what string should i check?)<br>
3. Isnt there a easy and nice way to know using nagios that which services are installed on a system, running or not...??<br>4. What if i monitor a service thats even not installed?<br>5. Is it okay to have multiple definitions of the same host with exact same text in nagios? If no, what about if just the IP remains same?