NagiosExchange
NagiosForge
NagiosWiki
Nagios Community Platform powered by NETWAYS

NagiosForge:CodeSnippets

Search  
From NagiosWiki
Jump to: navigation, search

Contents

Create, Search and View Snippets

You can archive Code Snippets, scripts, and functions to share with the User Community.
Code Snippets are a type of code fragment library. For example, you may desire to store sophisticated shell commands, JavaScript functions, one line Perl commands, an SQL expression that performs a special query, or an algorithm.
After creating a new Code Snippet, you can post additional files to share. Registered User can add and editing a Code Snippet and they are site1wide functions that can be viewed by anyone.

Overview

Image:Snippets01.jpg

  • Description the several fields:
    • Search Snippets by Category – View Snippets by their Trove Categorization.
    • Name – Name of the Snippet. Click to view the Snippet details.
    • Created By – Name of the user who uploaded the Snippet. Click to view the user details.
    • Show – Click to show the Snippets in this category.
    • Add Filter – Click to filter the Snippets in this category.
    • Search for Snippets in all Categories – Search for Snippets in all categories.
    • Search Field – Enter the criteria for your search and click the Search button.
    • Edit – Edits the Snippet.
    • Delete – Deletes the Snippet.
    • Add new Snippet – Adds a new Snippet.



Viewing Code Snippets

To view a Code Snippet:

  • Click the Snippets tab.
  • Search for the Snippet over the Category or Search Field.
  • Click on the Snippet you desire to view.

Image:Snippets02.jpg

  • Click the File name to view the Snippet.

Image:Snippets03.jpg

Submitting a New Code Snippet

To submit a Code Snippet:

  • Log in to NagiosForge.
  • Click the Snippets tab.
  • Click Add New Snippet.
  • Enter the criteria.
  • Click the Add button.

Image:Snippets04.jpg

  • Description the several fields:
    • Name – Name your Code Snippet.
    • Description – Describe what the Code Snippet does.
    • Add new file – Location of a file to be added into this Snippet.
    • Browse – Launches a dialog to locate the file to be added into this Snippet.
    • License – Name of license being used.
    • Programming Language – Name of computer language being used.
    • Topic – Topic of the Code Snippet.
    • Add – Click to submit a new Code Snippet.



Editing a Code Snippet

To edit a Code Snippet that you created:

  • Log in to NagiosForge?.
  • Click the Snippets tab.
  • Click on Edit next to the Snippet you desire to edit.
  • Edit any information you desire.
  • Click Save Changes.

Image:Snippets05.jpg