Giter VIP home page Giter VIP logo

nagios-status-json's Introduction

Nagios Status JSON

Nagios Status JSON

This PHP API script reads Nagios status.dat file and return the JSON result. This API is desinged for Nagios Client unofficial Nagios status monitoring app.

Step 1

Upload nath_status.php to your Nagios web root folder. ###Nagios Core's 3.5.1 default Web Root folder Web Root Folder - Centos /usr/share/nagios/html/

###Nagios Core's default Web Root folder Web Root Folder - Centos & Ubuntu /usr/local/nagios/share/

###NagiosXI's default Web Root folder Web Root Folder - Centos & Ubuntu /usr/local/nagiosxi/html/

Step 2

Edit nath_status.php. You can use your favourite text editor

vi /usr/local/nagios/share/nath_status.php

Change status.dat file's path according to your Nagios Server configuration.

$statusFile = '/usr/local/nagios/var/status.dat';

###Nagios Core's 3.5.1 status.dat file's location: /var/log/nagios/status.dat

Use following command to find status.dat location.

find / -name status.dat

Step 3

Download and Configure iPhone or Android Server Alarms Nagios Client

Nagios Client

Go to settings

Settings

Update URL ###Nagios Core (http or https)://nagiosserver_address/nagios/

###NagiosXI (http or https)://nagiosserver_address/nagiosxi/

URL Update

#Step 5 ###Add IOS Push Notification and Android FCM Notification

    /usr/local/nagios/libexec/
  • 3 Make ServerAlarmNotify.php file executable using following command.
    chmod +x ServerAlarmNotify.php
  • 4 Edit commands.cfg and add following two commands. You will find your under settings. Menu -> Setting. Settings
# 'sm-host-push-notify' command definition
define command{
    command_name 	sm-host-push-notify
    command_line 	/usr/local/nagios/libexec/ServerAlarmNotify.php $HOSTNAME$ YOURGROUPKEY HOST $HOSTSTATE$
}


# 'sm-service-push-notify' command definition
define command{
  	command_name 	sm-service-push-notify
	command_line  	/usr/local/nagios/libexec/ServerAlarmNotify.php $HOSTNAME$ YOURGROUPKEY SERVICE $SERVICESTATE$
}

  • 5 Edit templates.cfg file. Modify Contact Templates and add sm-service-push-notify as service notification command and sm-host-push-notify as host notification command.

define contact{
        name                            generic-contact
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email,sm-service-push-notify
        host_notification_commands      notify-host-by-email,sm-host-push-notify
        register                        0       					
        }

  • 6 Nagios Client Generates GROUP API KEY using Nagios URL

    • All devices using same URL will get Notification simultaneously.
    • Every Android/IOS user has option to Turn off Notification for his device only.
  • 7 If your GROUP API KEY is not showing

    • Update URL
    • Turn OFF and ON Notification.

For support contact [email protected]

nagios-status-json's People

Contributors

asuknath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.