Monitoring website using status codes on Nagios

Please find the below steps to monitor the website using status codes.

Nagios supports monitoring the website using status coodes and there is a command in /etc/nagios-plugins/config/http.cfg .
Example:- We can use a command like below to monitor a URL like https://domain1.com.

define command{
   command_name    check_https_url
   command_line    /usr/local/nagios/libexec/check_http -H domain1.com -e 200,301,302
}

To add the comnmand to Nagios create a file named https_url.cfg in /etc/nagios-plugins/config/ with the above code (and reload nagios server).

To use the check_https_url add the code below to the host configuration file. For example (in /etc/nagios3/conf.d/server.cfg)

define service {
    host_name           domain1.com
    service_description WEB SERVICE
    check_command       check_https_url!8243!/services/echo%3Fwsdl2
    use                 generic-service
}

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top