logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Nagios monitoring for NWN2 (GameSpy ping)

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Sat Jun 14, 2008 2:08    Post subject: Nagios monitoring for NWN2 (GameSpy ping) Reply with quote

This performs the same function as the NWNX4 watchdog, in prinicple, so there may be only a limited advantage to deploying it over a game server already running with NWNX4.

In case you expect NWNX4 to fall over and die in a bad way (or are concerned about other possible breakage conditions that might happen without tripping any usual host-wide monitoring), then you might find it useful to support paging notifications for your NWN2 server via Nagios.

Doing this is fairly simple and can be done using the built-in nagios check_udp query plugin. First, one defines a new check command for querying an NWN2 game server in checkcomamnds.cfg (be careful of wordwrapping on the forum):

Code:
define command{
        command_name    check_nwn2
        command_line    /usr/lib/nagios/plugins/check_udp -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$ -s "BNLM" -e "BNLR" -4
        }


(This assumes that nagios's standard plugin distribution is installed at /usr/lib/nagios/plugins/ .)

Then, simply define an entry for NWN2 in services.cfg for the host in question:

Code:
define service{
        use                             generic-service         ; Name of service template to use

        host_name                       my_gameserver_nagios_hostname
        service_description             Neverwinter Nights 2
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        contact_groups                  my_paging_group
        notification_interval           1440
        notification_period             24x7
        notification_options            c,r
        check_command                   check_nwn2!5121!2!5
        }


This will create a periodic query against the GameSpy ping responder in nagios for your host. The arguments to check_nwn2 are:

- Port number of game server (typically 5121).
- Max response time in seconds for the service to be considered WARNING.
- Max response time in seconds for the service to be considered CRITICAL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group