Nope, installed only one time.
The only installations that I did after installing Nagios was installing Cacti.
Ubuntu 12.04 LTS and Nagios
Re: Ubuntu 12.04 LTS and Nagios
OK, I think we made a mistake here... Remove the check_http command definition that you added in the "/etc/nagios3commands.cfg":
This is already defined in the "/etc/nagios-plugins/config/http.cfg", that's why you get a "duplicate definition" error.
Verify your configuration by running:
If there are no errors, restart nagios:
Next, run the following commands:
Go to the web interface, click on your "HTTP" service, then click on "Re-schedule the next check of this service" link from the "Service Commands" menu on the right and see if the status will change.
Code: Select all
define command {
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
Verify your configuration by running:
Code: Select all
/usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg
Code: Select all
service nagios3 restart
Code: Select all
usermod -G nagios www-data
chown nagios:www-data /var/lib/nagios3/rw/nagios.cmd
service nagios3 restart
service apache2 restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Ubuntu 12.04 LTS and Nagios
/usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg
[Most output cut out]
Total Warnings: 0
Total Errors: 0
Restart Apache and Nagios, did go to the Nagios web interface -> Services -> HTTP -> Re-schedule the next check of this host -> Pressed Commit -> Pressed Done.
Now the status is OK under the Services tab.
Service State Information
Current Status:
OK
(for 1d 6h 54m 51s)
Status Information: HTTP OK: HTTP/1.1 301 Moved Permanently - 559 bytes in 0,070 second response time
Performance Data: time=0,069996s;;;0,000000 size=559B;;;0
Current Attempt: 1/4 (HARD state)
Last Check Time: 2013-08-08 15:34:26
Check Type: ACTIVE
Check Latency / Duration: 2.035 / 0.079 seconds
Next Scheduled Check: 2013-08-08 15:39:26
Last State Change: 2013-08-07 08:41:52
Last Notification: N/A (notification 0)
Is This Service Flapping?
NO
(0.00% state change)
In Scheduled Downtime?
NO
Last Update: 2013-08-08 15:36:39 ( 0d 0h 0m 4s ago)
The host however stays down (in a red background color).
Certainly we've come alot further, do you know what caused initially the problem that the service was down?
And how does Nagios determine that the host is down?
google View Service Details For This Host
DOWN 2013-08-08 15:39:29 1d 6h 52m 8s CRITICAL - Network Unreachable (google.com)
Host Status:
DOWN
(for 1d 6h 52m 32s)
Status Information: CRITICAL - Network Unreachable (google.com)
Performance Data:
Current Attempt: 1/10 (HARD state)
Last Check Time: 2013-08-08 15:40:39
Check Type: ACTIVE
Check Latency / Duration: 0.183 / 0.036 seconds
Next Scheduled Active Check: 2013-08-08 15:45:49
Last State Change: 2013-08-07 08:48:32
Last Notification: 2013-08-07 08:48:32 (notification 1)
Is This Host Flapping?
NO
(0.00% state change)
In Scheduled Downtime?
NO
Last Update: 2013-08-08 15:40:59 ( 0d 0h 0m 5s ago)
Thanks so much for the help so far!
[Most output cut out]
Total Warnings: 0
Total Errors: 0
Restart Apache and Nagios, did go to the Nagios web interface -> Services -> HTTP -> Re-schedule the next check of this host -> Pressed Commit -> Pressed Done.
Now the status is OK under the Services tab.
Service State Information
Current Status:
OK
(for 1d 6h 54m 51s)
Status Information: HTTP OK: HTTP/1.1 301 Moved Permanently - 559 bytes in 0,070 second response time
Performance Data: time=0,069996s;;;0,000000 size=559B;;;0
Current Attempt: 1/4 (HARD state)
Last Check Time: 2013-08-08 15:34:26
Check Type: ACTIVE
Check Latency / Duration: 2.035 / 0.079 seconds
Next Scheduled Check: 2013-08-08 15:39:26
Last State Change: 2013-08-07 08:41:52
Last Notification: N/A (notification 0)
Is This Service Flapping?
NO
(0.00% state change)
In Scheduled Downtime?
NO
Last Update: 2013-08-08 15:36:39 ( 0d 0h 0m 4s ago)
The host however stays down (in a red background color).
Certainly we've come alot further, do you know what caused initially the problem that the service was down?
And how does Nagios determine that the host is down?
google View Service Details For This Host
DOWN 2013-08-08 15:39:29 1d 6h 52m 8s CRITICAL - Network Unreachable (google.com)
Host Status:
DOWN
(for 1d 6h 52m 32s)
Status Information: CRITICAL - Network Unreachable (google.com)
Performance Data:
Current Attempt: 1/10 (HARD state)
Last Check Time: 2013-08-08 15:40:39
Check Type: ACTIVE
Check Latency / Duration: 0.183 / 0.036 seconds
Next Scheduled Active Check: 2013-08-08 15:45:49
Last State Change: 2013-08-07 08:48:32
Last Notification: 2013-08-07 08:48:32 (notification 1)
Is This Host Flapping?
NO
(0.00% state change)
In Scheduled Downtime?
NO
Last Update: 2013-08-08 15:40:59 ( 0d 0h 0m 5s ago)
Thanks so much for the help so far!
Re: Ubuntu 12.04 LTS and Nagios
Your host definition is:
Unless you have a command, specified in the "generic-host" template, the check would fail, because you don't have a command defined. You can change your config to look like this:
...restart nagios:
and try your check again.
Code: Select all
define host{
use generic-host
host_name google
alias google
address google.com
}
Code: Select all
define host{
use generic-host
host_name google
alias google
address google.com
check_command check_http
}
Code: Select all
service nagios3 restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Ubuntu 12.04 LTS and Nagios
Changed my config to this:
root@h2200554:/etc/nagios3/conf.d# cat test.cfg
define host{
use generic-host
host_name google
alias google
address google.com
check_command check_http
}
define service{
use generic-service
host_name google
service_description HTTP
check_command check_http
}
AND ALL WORKS FINE!!
My host is up in Nagios.
I can't tell you how much I appreciate the effort.
Thanks!
PS: Why do I still need the check_command check_http in the define_service area since its already defined in the host area?
root@h2200554:/etc/nagios3/conf.d# cat test.cfg
define host{
use generic-host
host_name google
alias google
address google.com
check_command check_http
}
define service{
use generic-service
host_name google
service_description HTTP
check_command check_http
}
AND ALL WORKS FINE!!
My host is up in Nagios.
I can't tell you how much I appreciate the effort.
Thanks!
PS: Why do I still need the check_command check_http in the define_service area since its already defined in the host area?
Re: Ubuntu 12.04 LTS and Nagios
You don't necessarily need the service check, but if you want your host to populate certain portions of the interface (hostgroup summary, etc), you will need to define at least one service for the host.dominicw wrote: PS: Why do I still need the check_command check_http in the define_service area since its already defined in the host area?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.