2 Replies Latest reply: May 19, 2011 1:06 PM by seigniory RSS

Tip: Linux Configs in NCM

rtobyr
Currently Being Moderated

It's not the most elegant solution in the world, but I managed to get this working. Let's say that you want version control for httpd.conf and php.ini on a *nix server is running SSH. Here's what I did. First, I created a bash script called "Show" (you must use a capital "S") somewhere in the path (I used /usr/local/sbin). It looks like this:

=== BEGIN SCRIPT ===

#! /bin/sh

echo *** HTTPD.CONF ***

cat /path/to/httpd.conf

echo *** PHP.INI ***

cat /path/to/php.ini

=== END SCRIPT ===

Don't forget to chmod a+x Show

Then I gave NCM a login to the Linux server, and told it that there is no enable password. It worked!

  • Re: Tip: Linux Configs in NCM
    fcaron
    Currently Being Moderated

    wow, impressive

    tks for sharing!

  • Re: Tip: Linux Configs in NCM
    seigniory
    Currently Being Moderated

    I just tested this and it works like a charm!  Now I'm off to put together a bunch of 1-liners that will grab various config files.  For example, I use this line in the config to grab all of my primary DNS zone files, even if some new ones are created:

    find /var/named/chroot/var/named/master/*.dns -print | xargs -I {} sh -c 'echo {}; cat {};'

    This prints out the name of the DNS file, and then the contents of the file.

    ONE NOTE:  When setting up the device in NCM, I had to manually set the template to "Generic" or NCM wouldn't attempt a login due to "cannot determine device type".  Then again, I don't have SNMP enabled on the Linux host, so YMMV.

    All in all, this is one of the best tips I've seen on the Thwack forums over the years.  Nice work!

More Like This

  • Retrieving data ...