On Apr 10, 5:12 pm, John Chris Richards <john.chris.richa...@gmail.com> wrote: > Hi all > > I wanna take a list of running services on the client instantly. Can I > do this with puppet?
Not really, no. Puppet does not query client nodes, neither on a schedule nor on demand, and it does not track information about resources (such as Services) that are not managed for the node in question. > For example, is it possible to write a custom facter and send it to > the client so I can get the running services information whenever I > want via REST. Is my logic correct? No, your logic is not correct. You could certainly write a custom fact that collects information about the services running on a client, but that will not allow you to obtain an up-to-date result on demand. The client will publish the fact value every time it requests a catalog from the master (every 30 minutes by default), and there are several ways you could cause the master to store that information somewhere, but that's not the same thing. >Or there is another thing to solve > this problem? Not in full generality, no, because there's no reliable way to determine what processes running on the client are "services". Basically, you can do something like this: ssh <root@node> -c "ps -e" , which gives you all running processe without distinguishing what might be a service (whatever that means to you). Or you can do something like this: ssh <root@node> -c "for s in $(/sbin/chkconfig --list); do /sbin/ service $s status; done" , which tells you (on a system with chkconfig) which registered services are running, as judged by their initscripts' "status" command. That doesn't tell you anything about unregistered services, however, and it may not be 100% reliable for registered ones. Or you can write a custom service inquiry script of any complexity you desire, push it out to clients with Puppet, and run it at need. MCollective might provide a convenient interface for issuing the remote commands (instead of ssh -c), but it doesn't solve the underlying problem of how to determine what services are running. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.