Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ?
I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
Sent from my iPhone
On 2014-10-16 8:47 am, Darian Jimenez wrote:
Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ?
I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
I've done something like this, regularly query our inventory management system and then check if the relevant devices exist in the Observium devices table.
if exists then skip; else ./add_device $hostname; end
This relies on you being able to generate DNS names from whatever system already knows about the device you need to add. If this is an inventory tracking system that might not be a field. If you're parsing zone files though it shouldn't be challenging at all.
I didn't try very hard to automate the other way though. If a device exists in Observium but not inventory management then it sends an email and I go and manually click delete.
Cameron,
Do you mind sharing this?
I can generate DNS names from active directory via powershell
Sent from my iPhone
On Oct 15, 2014, at 11:20 PM, Cameron Daniel cdaniel@nurve.com.au wrote:
On 2014-10-16 8:47 am, Darian Jimenez wrote: Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ? I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
I've done something like this, regularly query our inventory management system and then check if the relevant devices exist in the Observium devices table.
if exists then skip; else ./add_device $hostname; end
This relies on you being able to generate DNS names from whatever system already knows about the device you need to add. If this is an inventory tracking system that might not be a field. If you're parsing zone files though it shouldn't be challenging at all.
I didn't try very hard to automate the other way though. If a device exists in Observium but not inventory management then it sends an email and I go and manually click delete.
Hello
If you run ./add_device.php <file> and file contains a bunch of hostnames where several already exists in observium, they will be skipped.
No need to create a script for that, just add it to cron with your other observium-jobs. Ours looks like this: */8 * * * * root /var/www/add_device.php lab_devices && /var/www/discovery.php -h new >> /dev/null 2>&1
Might not be best-practice, but it works nice :)
David Hulth Lab Technician Procera Networks AB
On 10/16/2014 11:55 AM, Darian Jimenez wrote:
Cameron,
Do you mind sharing this?
I can generate DNS names from active directory via powershell
Sent from my iPhone
On Oct 15, 2014, at 11:20 PM, Cameron Daniel cdaniel@nurve.com.au wrote:
On 2014-10-16 8:47 am, Darian Jimenez wrote: Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ? I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
I've done something like this, regularly query our inventory management system and then check if the relevant devices exist in the Observium devices table.
if exists then skip; else ./add_device $hostname; end
This relies on you being able to generate DNS names from whatever system already knows about the device you need to add. If this is an inventory tracking system that might not be a field. If you're parsing zone files though it shouldn't be challenging at all.
I didn't try very hard to automate the other way though. If a device exists in Observium but not inventory management then it sends an email and I go and manually click delete.
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Thanks David. Yea I ask because i don't know much about Linux and cron jobs.
I did the discovery and polling with the new argument for host the other day and it didn't pick up the host I had added .
Also know how to set a timer on the cron job?
Sent from my iPhone
On Oct 16, 2014, at 6:16 AM, David Hulth david.hulth@proceranetworks.com wrote:
Hello
If you run ./add_device.php <file> and file contains a bunch of hostnames where several already exists in observium, they will be skipped.
No need to create a script for that, just add it to cron with your other observium-jobs. Ours looks like this: */8 * * * * root /var/www/add_device.php lab_devices && /var/www/discovery.php -h new >> /dev/null 2>&1
Might not be best-practice, but it works nice :)
David Hulth Lab Technician Procera Networks AB
On 10/16/2014 11:55 AM, Darian Jimenez wrote: Cameron,
Do you mind sharing this?
I can generate DNS names from active directory via powershell
Sent from my iPhone
On Oct 15, 2014, at 11:20 PM, Cameron Daniel cdaniel@nurve.com.au wrote:
On 2014-10-16 8:47 am, Darian Jimenez wrote: Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ? I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
I've done something like this, regularly query our inventory management system and then check if the relevant devices exist in the Observium devices table.
if exists then skip; else ./add_device $hostname; end
This relies on you being able to generate DNS names from whatever system already knows about the device you need to add. If this is an inventory tracking system that might not be a field. If you're parsing zone files though it shouldn't be challenging at all.
I didn't try very hard to automate the other way though. If a device exists in Observium but not inventory management then it sends an email and I go and manually click delete.
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
Hi,
If I remember correctly, you can't pass a file as argument to discovery.php or poller(-wrapper).php, but only to add_device.php. As with any other host you're trying to add to Observium you have to make sure that the host running Observium can resolve the hostname or it will fail when trying to add.
You should already have a cronjob in place for discovery and polling, assuming you've followed the debian install instructions available on the Observium webpage. My line below is in addition to the lines from the install instructions.
If you want to change the "timers" on the cron, an easy way for a beginner (this includes me :P) is to use http://www.crontab-generator.org/
David Hulth Lab Technician Procera Networks AB
On 10/16/2014 01:04 PM, Darian Jimenez wrote:
Thanks David. Yea I ask because i don't know much about Linux and cron jobs.
I did the discovery and polling with the new argument for host the other day and it didn't pick up the host I had added .
Also know how to set a timer on the cron job?
Sent from my iPhone
On Oct 16, 2014, at 6:16 AM, David Hulth david.hulth@proceranetworks.com wrote:
Hello
If you run ./add_device.php <file> and file contains a bunch of hostnames where several already exists in observium, they will be skipped.
No need to create a script for that, just add it to cron with your other observium-jobs. Ours looks like this: */8 * * * * root /var/www/add_device.php lab_devices && /var/www/discovery.php -h new >> /dev/null 2>&1
Might not be best-practice, but it works nice :)
David Hulth Lab Technician Procera Networks AB
On 10/16/2014 11:55 AM, Darian Jimenez wrote: Cameron,
Do you mind sharing this?
I can generate DNS names from active directory via powershell
Sent from my iPhone
On Oct 15, 2014, at 11:20 PM, Cameron Daniel cdaniel@nurve.com.au wrote:
On 2014-10-16 8:47 am, Darian Jimenez wrote: Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ? I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
I've done something like this, regularly query our inventory management system and then check if the relevant devices exist in the Observium devices table.
if exists then skip; else ./add_device $hostname; end
This relies on you being able to generate DNS names from whatever system already knows about the device you need to add. If this is an inventory tracking system that might not be a field. If you're parsing zone files though it shouldn't be challenging at all.
I didn't try very hard to automate the other way though. If a device exists in Observium but not inventory management then it sends an email and I go and manually click delete.
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
David,
Thanks! I do have the cron jobs setup from the guide. Yea I am passing the file name to the add_device.php only. The other two php (discovery & poller) I just use the -h new.
On Thu, Oct 16, 2014 at 11:16 AM, David Hulth < david.hulth@proceranetworks.com> wrote:
Hi,
If I remember correctly, you can't pass a file as argument to discovery.php or poller(-wrapper).php, but only to add_device.php. As with any other host you're trying to add to Observium you have to make sure that the host running Observium can resolve the hostname or it will fail when trying to add.
You should already have a cronjob in place for discovery and polling, assuming you've followed the debian install instructions available on the Observium webpage. My line below is in addition to the lines from the install instructions.
If you want to change the "timers" on the cron, an easy way for a beginner (this includes me :P) is to use http://www.crontab-generator.org/
David Hulth Lab Technician Procera Networks AB
On 10/16/2014 01:04 PM, Darian Jimenez wrote:
Thanks David. Yea I ask because i don't know much about Linux and cron jobs.
I did the discovery and polling with the new argument for host the other day and it didn't pick up the host I had added .
Also know how to set a timer on the cron job?
Sent from my iPhone
On Oct 16, 2014, at 6:16 AM, David Hulth <david.hulth@proceranetworks.
com> wrote:
Hello
If you run ./add_device.php <file> and file contains a bunch of hostnames where several already exists in observium, they will be skipped.
No need to create a script for that, just add it to cron with your other observium-jobs. Ours looks like this: */8 * * * * root /var/www/add_device.php lab_devices && /var/www/discovery.php -h new >> /dev/null 2>&1
Might not be best-practice, but it works nice :)
David Hulth Lab Technician Procera Networks AB
On 10/16/2014 11:55 AM, Darian Jimenez wrote:
Cameron,
Do you mind sharing this?
I can generate DNS names from active directory via powershell
Sent from my iPhone
On Oct 15, 2014, at 11:20 PM, Cameron Daniel cdaniel@nurve.com.au
wrote:
On 2014-10-16 8:47 am, Darian Jimenez wrote: Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ? I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
I've done something like this, regularly query our inventory management system and then check if the relevant devices exist in the Observium devices table.
if exists then skip; else ./add_device $hostname; end
This relies on you being able to generate DNS names from whatever system already knows about the device you need to add. If this is an inventory tracking system that might not be a field. If you're parsing zone files though it shouldn't be challenging at all.
I didn't try very hard to automate the other way though. If a device exists in Observium but not inventory management then it sends an email and I go and manually click delete.
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
On 16.10.2014 02:47, Darian Jimenez wrote:
Has anyone done a script where it can every 30 minutes or every hour read server names from a text file and add the device and discovery and poll it automatically ?
I want to be able to add servers into the domain and have observium discovery them automatically via snmp.
$ ./add_device.php
USAGE: add_device.php <hostname> [community] [v1|v2c] [port] [udp|udp6|tcp|tcp6] add_device.php <hostname> [any|nanp|anp|ap] [v3] [user] [password] [enckey] [md5|sha] [aes|des] [port] [udp|udp6|tcp|tcp6] *add_device.php <filename>*
you can specify filename as a parameter in add_device.php where each line is hostname with (or without) snmp parameters same as in command line like: #----- one.device.com second.device.commy_community v2c third.device.com anp v3 my_user my_pass my_enc_key sha des #-----
If snmp parametrs not specified in file than used autodetect with paramets specified in config:
// SNMPv1/2c $config['snmp']['community'][1] = "my_community"; // Communities to try during adding hosts and discovery
// SNMPv3 // The array can be expanded to give another set of parameters $config['snmp']['v3'][1]['authlevel'] = "noAuthNoPriv"; // noAuthNoPriv | authNoPriv | authPriv $config['snmp']['v3'][1]['authname'] = "observium"; // User Name (required even for noAuthNoPriv) $config['snmp']['v3'][1]['authpass'] = ""; // Auth Passphrase $config['snmp']['v3'][1]['authalgo'] = "MD5"; // MD5 | SHA $config['snmp']['v3'][1]['cryptopass'] = ""; // Privacy (Encryption) Passphrase $config['snmp']['v3'][1]['cryptoalgo'] = "AES"; // AES | DES
Note, for each snmp auth setyou should use a unique array key.
participants (4)
-
Cameron Daniel
-
Darian Jimenez
-
David Hulth
-
Mike Stupalov