Jump to content

bmike78

Members
  • Posts

    4
  • Joined

  • Last visited

Reputation

10 Good

About bmike78

Personal Information

  • Occupation
    Internet Support
  • Location
    Davenport, IA

Employer (optional)

  • Company Represented
    CIPAFilter
  1. Some output of the errors you're receiving would be helpful in fixing the problem. Run /etc/init.d/mysql and post the results. Also post your mysql config file for us to look at. I have this in my my.cnf file: # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1 If you don't have this in your my.cnf file, you can just add it in and then try restarting mysql If it's running, then you'll see that if you run netstat and grep for 3306, which is the default port for mysql: root@ubuntu-monitoring:/etc/mysql# netstat -an | grep 3306 tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN You'll also be able to telnet to it and get some kind of response: root@ubuntu-monitoring:/etc/mysql# telnet 127.0.0.1 3306 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. @ 5.0.75-0ubuntu10.5!/+*/O~PR,*xD&1c!vT!Cn I would suggest keeping it just bound to 127.0.0.1 if you're just going to query it from Apache if it's hosted on the same machine. No sense in having it listen on the public interface unless you want outsiders trying to connect to it.
  2. Forgot to add this... at the top of the php script, it's going to put some temp files here. // Directory for temp files with / at the end $directory_for_temp_files = "/usr/local/groundwork/nagios/libexec/temp/"; You may need to change to be a directory that you have in your filesystem...
  3. RabbieBurns, This looks like a php script that is run via shell to return exit codes. Nagios then interprets these exit codes as: 0 OK 1 WARNING 2 CRITICAL anything else as Unknown Having written custom checks before, Nagios is just looking for these exit codes to determine if the threshold you're defining is 0,1,2 and based on this return code, it knows what to do and what to display. Here are the variables you need to pass: function usage($msg) { print(basename($_SERVER["argv"][0]) . " v" . VERSION . " (" . VERDATE .")\n\n"); print(basename($_SERVER["argv"][0]) . " -H -c -w \n"); print(" -H Host to check (IP Address)\n"); print(" -c Critical toner threshold (percentage of remaining toner)\n"); print(" -w Warning toner threshold (percentage of remaining toner\n"); You'll want to set something up in commands.cfg like so: define command{ command_name check_hp2600 command_line /usr/bin/php /usr/lib/nagios/plugins/check_hp_2600.php -H '$HOSTADDRESS$' -c 10 -w 20 } As an example, I'm saying 10% toner left is critical, 20% left is warning and your php binary is located in /usr/bin/ Then you will want to define this check in your printer.cfg file (guessing this is where you have your printer hosts defined. # check_hp2600 check define service{ use generic-service hostgroup hp2600_printers service_description HP 2600 Toner Level check_command check_hp2600 } You just need to put all the hp2600 printers in their own hostgroup called hp2600_printers and the check should work. If you have problems, then try running the command from the Nagios server's shell: /usr/bin/php /usr/lib/nagios/plugins/check_hp_2600.php -H -c 10 -w 20
  4. It should not overwrite your existing configs. The build should drop the files into the src/ directory and then from there you would copy the files to where they need to go. Depending on what version you're coming from, there might be some changes to how the config files are laid out. Assuming that you're upgrading to the latest version, what version are you currently running? Hopefully you should be backing those up? Make sure you back up /etc/nagios/, /etc/nagios3/, /usr/lib/cgi-bin/nagios3/, /usr/lib/nagios/plugins/ directories. Also if you're doing an upgrade to the latest, you should also get the latest nagios-plugins at the Nagios website. There can be changes in the nagios core binaries that might not work with the older plugins, so I always suggest upgrading plugins if you're upgrading Nagios. If your comfort level is kind of low, maybe you can install Nagios on a different box and then copy the config files over to it to test things out.
×
×
  • Create New...